我必须实现具有以下功能的图像滑块:
我不想要fadein fadeout类型滑块
到目前为止我所尝试的内容如下:
<!DOCTYPE html>
<html>
<head>
<title>auto slider</title>
<style>
.container{width:1000px; height:100px; position:relative;}
.slide{width:1000px; height:100px; position:absolute; left:0; top:0;}
</style>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function(){
var slideWidth = 1000;
startSlider();
function startSlider() {
looper = setInterval(function () {
console.log("nishit");
$('.slide').animate({
'left': '-=' + (slideWidth) + 'px'
}, 500);
},1000);
}
});
</script>
</head>
<body>
<div class="container">
<div class="slide3">
<img src="http://s2.postimg.org/5uxqi0mgl/cats1.jpg" alt="">
</div>
<div class="slide">
<img src="http://s2.postimg.org/5uxqi0mgl/cats4.jpg" alt="">
</div>
<div class="slide">
<img src="http://s2.postimg.org/5uxqi0mgl/cats6.jpg" alt="">
</div>
</div>
</body>
</html>