2014-01-13 102 views
0

插件Unslider有這樣的功能:Unslider.js移動功能

// 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); 
       }); 
      } 
     }; 

有我怎麼可以讓unslider八方通左移任何IDEIA,而不是回第一張幻燈片晉級後?看到這裏的例子:http://unslider.com/

回答