raptor30506090 Posted July 18, 2012 Share Posted July 18, 2012 Hi guys new at this when the slide comes to the last image how do i make it go back to the first one cheers <div id="holder"> <div id="box"> <div class="1"><img src="test_image/1.jpg" width="520" height="248"></div> <div class="2"><img src="test_image/2.gif" width="520" height="248"></div> <div class="3"><img src="test_image/3.jpg" width="520" height="248"></div> <div class="4"><img src="test_image/4.jpg" width="520" height="248"></div> <div class="5"><img src="test_image/5.gif" width="520" height="248"></div> </div> <span><button id="left">«</button><button id="right">»</button></span> <div id="clear"></div> </div> <script type="text/javascript"> $("#left").click(function(){ $("#box").stop().animate({"left": "+=520px"}, "slow"); }); $("#right").click(function(){ $("#box").animate({"left": "-=520px"}, "slow"); }); </script> Link to comment https://forums.phpfreaks.com/topic/265881-new-at-this/ Share on other sites More sharing options...
Adam Posted July 18, 2012 Share Posted July 18, 2012 You just need to set the CSS left property back to 0: $("#box").stop().animate({"left": 0}, "slow"); Link to comment https://forums.phpfreaks.com/topic/265881-new-at-this/#findComment-1362405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.