Javascript Unslider.js移动函数
插件Unslider具有如下功能:Javascript Unslider.js移动函数,javascript,jquery,html,Javascript,Jquery,Html,插件Unslider具有如下功能: // Move Unslider to a slide index this.move = function(index, cb) { // If it's out of bounds, go to the first slide if(!this.items.eq(index).length) index = 0; if(index < 0) index = (
// Move Unslider to a slide index
this.move = function(index, cb) {
// If it's out of bounds, go to the first slide
if(!this.items.eq(index).length) index = 0;
if(index < 0) index = (this.items.length - 1);
var target = this.items.eq(index);
var obj = {height: target.outerHeight()};
var speed = cb ? 5 : this.opts.speed;
if(!this.ul.is(':animated')) {
// Handle those pesky dots
_.el.find('.dot:eq(' + index + ')').addClass('active').siblings().removeClass('active');
this.el.animate(obj, speed) && this.ul.animate($.extend({left: '-' + index + '00%'}, obj), speed, function(data) {
_.current = index;
$.isFunction(_.opts.complete) && !cb && _.opts.complete(_.el);
});
}
};
你知道我怎样才能让无滑翔器一直向左移动,而不是在到达最后一个滑梯后的第一个滑梯上向后移动吗?参见这里的示例:这将是一个未来的更新,由自己的开发者@idiot回答 开发分支{infinite:true}