国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

<label id="l8ye0"></label>
<bdo id="l8ye0"><mark id="l8ye0"><listing id="l8ye0"></listing></mark></bdo>
<label id="l8ye0"></label>
javascript - How to switch the last picture to the first picture in a seamless carousel?
習(xí)慣沉默
習(xí)慣沉默 2017-05-16 13:42:50
0
2
757
<script>
    var next = document.getElementById("next");
    var prev = document.getElementById("prev");
    var ul = document.getElementsByTagName("ul")[0];
    var li = document.getElementsByTagName("li");
    var x=0;
    next.onclick = function(){
        x = x -289;
        ul.style.transform="translate3d("+x+"px,0,0)";    
    }
    prev.onclick = function(){
        x = x +289;
        ul.style.transform="translate3d("+x+"px,0,0)";
    }
</script>
習(xí)慣沉默
習(xí)慣沉默

reply all(2)
大家講道理

You can copy the first one and put it at the end. For example: 123451
When the carousel reaches the last 1, return the entire carousel image to its original state.

大家講道理

Clone the carousel image into an identical one. (eg: (Picture 1 Picture 2 Picture 3) (Picture 1 Picture 2 Picture 3))

When the picture moves to the serial number 1, determine whether there is a previous element. If it does not move the entire sroll to the front, then do the carousel, otherwise it will be directly carousel (in this case, pay attention to the left value of the positioning) Change first then)

The same applies when moving to the last picture

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template