/ Published in: jQuery
content slider
Expand |
Embed | Plain Text
$(document).ready(function() { // Animations typs are = http://jqueryui.com/effect/#easing var speed = 750; // SET ANIMATION SPEED var type = 'swing'; // SET ANIMATION TYPE var contentSize = '800'; //Set Content Size var itemCount = $(".slider-navItem").length; //DO NOT CHANGE var contentWrapSize = contentSize; // DO NOT CHANGE var contentContainer = contentSize * itemCount; // DO NOT CHANGE var margLeft = 0; // DO NOT CHANGE // SET CSS SETTINGS $('.slider-content').css("width", contentSize + 'px'); $('#slider-contentContainer').css("width", contentContainer + 'px'); $('#slider-contentWrap').css("width", contentWrapSize + 'px'); // This is the whole Slider function $('.slider-navItem').click(function() { var index = $(".slider-navItem").index($(this)); $('#slider-contentContainer').animate({ marginLeft: margLeft-(contentSize*index) }, speed, type); }); });
You need to login to post a comment.
