开发者

i am trying to make this carousel to be moving towards the left on its own, anybody with help, am new here

开发者 https://www.devze.com 2023-03-18 02:28 出处:网络
<script type=\"text/javascript\" src=\"http://jqueryjs.googlecode.com/files/ jquery-1.3.2.min.js\"></script>
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/
jquery-1.3.2.min.js"></script>
<div id="container">
<div id="carousel">
//with in this div i made list of my images
</div>
<a id="navPrev" href="#">Next</a> <a id="navNext" href="#">Previous</a></div>
<script type="text/javascript">
$(document).ready(function(){
//Define the animation speed for the Carousel
var speed = 600;
$('#navPrev').click(function(){
//As the rest 开发者_如何学Cof our carousel is hidden, lets move it's margin left until
//it's in view
//We use the jQuery animate() function give this movement a nice smooth feel
$('#carousel ul').animate({marginLeft:'-280px'}, speed);
});
$('#navNext').click(function(){
//And now lets move back to the start of the Carousel
$('#carousel ul').animate({marginLeft:'1px'}, speed);
});});
</script> 


It's best for you if you just follow a tutorial instead of trying to do things by yourself, as plenty will come that you did not think about it yet, and all the links above already did.

28 Useful JQuery Sliders You Need To Download

13 Super Useful jQuery Content Slider Scripts and Tutorials

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号