Posted By

sebikovacs on 06/25/10


Tagged

slide


Versions (?)

Slide


 / Published in: jQuery
 

The javascript I use with the slide XHTML i posted before

  1. //slide cu butoane left right.............................
  2. $('.slideNav a').click(function(){
  3. var leftOrRight = $(this).attr('class');
  4. if (leftOrRight == 'left'){
  5. var noLeft = $(this).attr('id');
  6. if (noLeft != 'noLeft'){
  7. var linkRel = $(this).attr('rel');
  8. linkRel = parseInt(linkRel) - 1;
  9. if (linkRel == 1){
  10. $(this).attr('id','noLeft');
  11. }
  12. var element = $('#cell'+linkRel);
  13. $('.mask').scrollTo(element,500,{axis:'x'});
  14. $(this).attr('rel', linkRel);
  15. $('.slideNav a.right').attr('rel',linkRel);
  16. $('.slideNav a.right').removeAttr('id');
  17. }
  18. } else if (leftOrRight == 'right') {
  19. var noRight = $(this).attr('id');
  20. if (noRight != 'noRight'){
  21. maxNumber = $('.slide .wrap').children().size();
  22. var linkRel = $(this).attr('rel');
  23. linkRel = parseInt(linkRel) + 1;
  24. if (linkRel == maxNumber){
  25. $(this).attr('id','noRight');
  26. }
  27. var element = $('#cell'+linkRel);
  28. $('.mask').scrollTo(element,500,{axis:'x'});
  29. $(this).attr('rel', linkRel);
  30. $('.slideNav a.left').attr('rel',linkRel);
  31. $('.slideNav a.left').removeAttr('id');
  32. }
  33. }
  34. return false;
  35. });

Report this snippet  

You need to login to post a comment.