onload = start;
function start(){
var i = 1;
function Move(){
i = (i%3)+1; // 4 is the Number of image in slider
document.getElementById('t'+i).checked = true;
}
setInterval(Move,3000); //change img in 3 sec
}
body{ background-color:#0066FF;}
.ct{
position:relative;
width:400px;
height:220px;
margin:auto;
border:2px solid #000;
overflow:hidden;
}
input{ display:none;}
.img_s{ position:absolute;
width:100%;
height:100%;
z-index:-1;
font-size:25px;
text-align:center;
}
.im1, .im2, .im3{ position:relative; width:400px;
height:225px;
}
.pre, .nxt{ position:absolute;
width:12%;
height:100%;
top:0;
background:rgba(88,88,88,.4);
z-index:99;
cursor:pointer;
font-size:30px;
}
p{ position:relative; top:50px;
}
.pre{ left:0;
}
.nxt{ right:0;
}
.cr{ width:100%;
height:11px;
bottom:12px;
position:absolute;
text-align:center;
z-index:99;
}
.dts{ position: relative;
display: inline-block;
background:rgba(0,0,0,.4);
}
#t1:checked ~ #one,
#t2:checked ~ #two,
#t3:checked ~ #three{
z-index:99; transition:all 0.5s;
}
<div class="ct">
<input type="radio" name="tabs" id="t1" checked/>
<input type="radio" name="tabs" id="t2"/>
<input type="radio" name="tabs" id="t3"/>
<div class="img_s" id="one">
<div class="im1" style="background-color: #FFF;">01-IMG</div>
<label for="t3" class="pre"><p>❮</p></label>
<label for="t2" class="nxt"><p>❯</p></label>
</div>
<div class="img_s" id="two">
<div class="im2" style="background-color:#0C3;">02-IMG</div>
<label for="t1" class="pre"><p>❮</p></label>
<label for="t3" class="nxt"><p>❯</p></label>
</div>
<div class="img_s" id="three">
<div class="im3" style="background-color:#F63;">03-IMG</div>
<label for="t2" class="pre"><p>❮</p></label>
<label for="t1" class="nxt"><p>❯</p></label>
</div>
</div>
I have a small slide, which works with radios and transition in JS. The code in the whole works normal, but I intend to increment in javascript that by leaning the mouse on top inside the slide box the JS transition of the pause radios giving the user the chance to click on the side arrows and select the images and when removing the mouse from inside the box the transition continues normally, would it be possible to increment with this simple code in javascript these functions ?? I tried here and I did not succeed,?