开发者

jQuery content slider: Simplest

I'm l开发者_JS百科ooking to make the simplest content slider possible. I don't want a plugin... I simply want an easy way to slide a couple of divs left and right based on next/previous buttons.

If I'm shooting myself in the foot, though, I'll just use a plugin. :)


The easiest way I believe is to use the anaimate function on your elements:

$("#left").click(function(){
  $(".block").animate({"left": "-=50px"}, "slow");
});

Look here for more info: http://api.jquery.com/animate/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜