/ Published in: jQuery

Simple carrusel horizontal jquery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$(document).ready(function(){ $('.atras').click(function(){ if($('.carrusel ul').attr('rel') == 1) return false; $('.carrusel ul').attr('rel',parseInt($('.carrusel ul').attr('rel')) - 1); $('.carrusel ul').animate({ marginLeft: '+=786' }, 1000, function() { }); }); $('.avanza').click(function(){ if($('.carrusel ul').attr('rel') == 4) return false; $('.carrusel ul').attr('rel',parseInt($('.carrusel ul').attr('rel')) + 1); $('.carrusel ul').animate({ marginLeft: '-=786' }, 1000, function() { }); }); });
Comments
