Slide horizontal (carrusel) jquery con ul y li


/ Published in: jQuery
Save to your folder(s)

Simple carrusel horizontal jquery


Copy this code and paste it in your HTML
  1. $(document).ready(function(){
  2. $('.atras').click(function(){
  3. if($('.carrusel ul').attr('rel') == 1) return false;
  4. $('.carrusel ul').attr('rel',parseInt($('.carrusel ul').attr('rel')) - 1);
  5. $('.carrusel ul').animate({
  6. marginLeft: '+=786'
  7. }, 1000, function() {
  8. });
  9. });
  10. $('.avanza').click(function(){
  11. if($('.carrusel ul').attr('rel') == 4) return false;
  12. $('.carrusel ul').attr('rel',parseInt($('.carrusel ul').attr('rel')) + 1);
  13. $('.carrusel ul').animate({
  14. marginLeft: '-=786'
  15. }, 1000, function() {
  16. });
  17. });
  18. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.