Помогите настроить автопрокрутку слайдера на сайте.
/*global window, jQuery */
(function($) {
// Default configuration properties.
var defaults = {
vertical: false,
rtl: false,
start: 1,
offset: 1,
size: null,
scroll: 1,
visible: null,
animation: 'normal',
easing: 'swing',
auto: 1,
wrap: null,
initCallback: null,
setupCallback: null,
reloadCallback: null,
itemLoadCallback: null,
itemFirstInCallback: null,
itemFirstOutCallback: null,
itemLastInCallback: null,
itemLastOutCallback: null,
itemVisibleInCallback: null,
itemVisibleOutCallback: null,
animationStepCallback: null,
buttonNextHTML: '<div></div>',
buttonPrevHTML: '<div></div>',
buttonNextEvent: 'click',
buttonPrevEvent: 'click',
buttonNextCallback: null,
buttonPrevCallback: null,
itemFallbackDimension: null
}, windowLoaded = false;
$(window).bind('load.jcarousel', function() { windowLoaded = true; });
/**
* Starts autoscrolling.
*
* @method auto
* @return undefined
* @param s {Number} Seconds to periodically autoscroll the content.
*/
startAuto: function(s) {
if (s !== undefined) {
this.options.auto = s;
}
if (this.options.auto === 0) {
return this.stopAuto();
}
if (this.timer !== null) {
return;
}
this.autoStopped = false;
var self = this;
this.timer = window.setTimeout(function() { self.next(); }, this.options.auto * 1000);
},
/**
* Stops autoscrolling.
*
* @method stopAuto
* @return undefined
*/
stopAuto: function() {
this.pauseAuto();
this.autoStopped = true;
},
/**
* Pauses autoscrolling.
*
* @method pauseAuto
* @return undefined
*/
pauseAuto: function() {
if (this.timer === null) {
return;
}
window.clearTimeout(this.timer);
this.timer = null;
},