Posted By

mcs88 on 01/17/13


Tagged

content slider


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

o0110o


Content Slider


 / Published in: jQuery
 

URL: slidedemo.maltesohns.de

content slider

  1. $(document).ready(function()
  2. {
  3. // Animations typs are = http://jqueryui.com/effect/#easing
  4. var speed = 750; // SET ANIMATION SPEED
  5. var type = 'swing'; // SET ANIMATION TYPE
  6. var contentSize = '800'; //Set Content Size
  7. var itemCount = $(".slider-navItem").length; //DO NOT CHANGE
  8. var contentWrapSize = contentSize; // DO NOT CHANGE
  9. var contentContainer = contentSize * itemCount; // DO NOT CHANGE
  10. var margLeft = 0; // DO NOT CHANGE
  11. // SET CSS SETTINGS
  12. $('.slider-content').css("width", contentSize + 'px');
  13. $('#slider-contentContainer').css("width", contentContainer + 'px');
  14. $('#slider-contentWrap').css("width", contentWrapSize + 'px');
  15. // This is the whole Slider function
  16. $('.slider-navItem').click(function()
  17. {
  18. var index = $(".slider-navItem").index($(this));
  19. $('#slider-contentContainer').animate({
  20. marginLeft: margLeft-(contentSize*index)
  21. }, speed, type);
  22. });
  23. });

Report this snippet  

You need to login to post a comment.