JQuery Content Slider: Simple

I want to make the simplest content slider possible. I don’t want a plugin ... I just want an easy way to slide div pairs left and right based on the next / previous buttons.

If I shoot myself in the foot, I just use the plugin. :)

+4
source share
1 answer

The easiest way is to use the anaimate function for your elements:

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

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

+2
source

Source: https://habr.com/ru/post/1333504/


All Articles