开发者

jQuery content slider: Simplest

开发者 https://www.devze.com 2023-02-01 15:29 出处:网络
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.

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

精彩评论

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