/**
* some stuff here and such...
*
*/
var timelist = 100; // start time, time of first slide elm.
var timeduration = 100; // this will add time to each elm.
var effectin = 'easeOutQuart'; // jq ui easing effect for elms sliding in view.
var effectout = 'easeInBack'; // jq ui easing effect for elms sliding out of view.
var Pdistance = 1000; // distance of slide out and in.
// Do not change below //
var Ndistance = -Pdistance;
var ulTotalWidth = 0;
var timeArray = [];
var runActions = true;
for (var x=0; x < 6; x++) {
timeArray[x] = timelist;
timelist = timelist + timeduration;
};
$(function(){
// setup slides
$('.scrollGuideWrap ul').hide();
$('.guideCats a').each(function(i){
$(this).addClass('slide'+i).attr('page',i);
});
$('.scrollGuideWrap ul').each(function(i){
var thiswidth = $(this).width();
$(this).addClass('slides next slide'+i).attr('page',i).show();
ulTotalWidth = ulTotalWidth + thiswidth;
});
find_active();
$('body').on('click','.guideCats a',function(e){
if(runActions == true && !$(this).hasClass('active')){ // check if slide is running
var current = $('.guideCats').find('.active').attr('page');
var thiscenter = $(this).width() / 2;
var thispos = $(this).position();
var newpos = thispos.left + thiscenter + 7;
var pageNum = $(this).attr('page');
var thisslide = $('ul.slide'+pageNum);
$('.guideCats a').removeClass('active').css('cursor', 'wait');
$(this).addClass('active');
$('.dwnArrow').animate({'left': newpos,'margin-left':'0'},300);
animate_li(thisslide, $('ul.slide'+current));
runActions = false;
}
e.preventDefault();
});
});
function find_active(){
var active = $('.guideCats a.active');
var newpos = (active.width()/2) + active.position().left + 7;
var slideNum = 'ul.slide'+active.attr('page');
// setup slides area
$('.scrollGuideWrap').width(ulTotalWidth);
$(slideNum).removeClass('next').prevAll().addClass('prev').removeClass('next');
// change the...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.