Response title
This is preview!
//get the width of all the li's in the list
var ulwidth = 0;
$('div.scrollMask li').each(function(index) {
ulwidth += $(this).outerWidth();
});
if ($('div.scrollMask ul li').size() > 0) {
scrollConfig = {
prev: '#severe-weather a.forward',
next: '#severe-weather a.back',
items: 'li',
axis: 'x',
step: 1,
maxdisplayInt : 9,//total number of items
cycle:true,
easing: 'linear',
interval: 1,
duration: 1980,
onBefore: function(e,elem,$pane,$items,pos) {//function that provides continuos loop
console.log($pane);
if (pos === scrollConfig.maxdisplayInt-2) {
console.log("jump back now");
$('div.scrollMask').queue('fx',[]).stop().trigger('stop');
$('div.scrollMask li:first').css({'margin-left' : '0'});
$('div.scrollMask').trigger('start');
return false;
}
},
force: true
}
$('div.scrollMask').serialScroll(scrollConfig);
$('#severe-weather').hover(function(){
$('div.scrollMask').queue('fx',[]).stop().trigger('stop');
},function(){
$('div.scrollMask').trigger('start');
});
}
© 2013 jQuery Foundation
Sponsored by and others.