jquery - how do i make a div slide left 100px everytime i click a link
What i have so far is this
$(function(){
$("#click").click(function(){
$("#slide").animate(开发者_开发知识库{marginLeft:'100px'},'slow');
});
});
Heres a link to a demo
Which works only once, but if i try to click the link again, Nothing happens
how do I make it so it works more like a slideshow? so everytime I click, it slides left
Something like this. You use +=
expression:
$(function(){
$("#click").click(function(){
$("#slide").animate({left:'+=100px'},'slow');
});
});
精彩评论