日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > web前端 > jquery > jQuery插件:jQuery.slide.4.0介紹

jQuery插件:jQuery.slide.4.0介紹

來源:程序員人生   發布時間:2014-05-13 12:24:58 閱讀次數:3020次

  更新jQuery.slide.4.0插件,新增自動循環滾動功能

  效果如下圖所示

image

if(typeof rady === 'undefined')
var rady = window.rady = {};
if(typeof liehuo.ui === 'undefined')
liehuo.ui = {};
(function($) {
liehuo.ui.slide = function(options) {
this.opts = $.extend({}, liehuo.ui.slide.defaults, options);

this._container = this.opts.itemContain;
this._showContain = this.opts.showContain;
this._containsize = this.opts.containSize;
this._left = this.opts.leftMove;
this._right = this.opts.rightMove;
this._auto = this.opts.auto;
this._timer = null;

this._itemCount = 0;
this._index = 0;
this.__play = null;
this._init();
};

liehuo.ui.slide.prototype = {
_init: function() {
var $this = this;
$this._itemCount = $($this._container).length;
$this._showContain = $($this.opts.showContain);
$this._bindEvent();
$this._showItems();
$this._startAuto();
},
_startAuto: function(s) {
if (s != undefined)
this.opts.auto = s;

if (this.opts.auto == 0)
return this._stopAuto();

if (this._timer != null)
return;

var $this = this;
this._timer = setInterval(function() { $this._moveRight(); }, this._auto * 1000);
},
_stopAuto: function() {
if (this._timer == null)
return;
clearTimeout(this._timer);
this._timer = null;
},
_bindEvent: function() {
var $this = this;
$($this._left).bind("click", function() {
$this._stopAuto();
$this._moveLeft();
}).mouseout(function() {
$this._startAuto();
});
$($this._right).bind("click", function() {
$this._stopAuto();
$this._moveRight();
}).mouseout(function() {
$this._startAuto();
});

$this._showContain.hover(function() {
$this._stopAuto();
},
function() {
$this._startAuto();
}
)
},
_moveLeft: function() {
var $this = this;
if ($this._index >= 0)
{ $this._index -= 1; }
else
{ $this._index = 11; }
$this._showItems();
},
_moveRight: function() {
var $this = this;
if ($this._index <= $this._itemCount)
{ $this._index += 1; }
else
{ $this._index = 0; }
$this._showItems();
},
_showItems: function() {
var $this = this;
$this._showContain.empty();
for (i = $this._index; i < $this._index + $this._containsize; i++) {
$this._showContain.append($($this._container).eq(i > 9 ? i % 9 : i).clone());
}
}
};

//設計選項默認值
liehuo.ui.slide.defaults = {
showContain: "#thumblist",
itemContain: ".thumblist a",
containSize: 4, //盒子大小
leftMove: "#leftarrow",
rightMove: "#rightarrow",
auto:2
};
})(jQuery)
生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
為碼而活
積分:4237
15粉絲
7關注
欄目熱點
關閉
程序員人生
主站蜘蛛池模板: 国产午夜av | 亚洲欧洲日本在线 | 免费看黄a| 在线免费观看视频一区二区三区 | 久久久免费观看视频 | 亚洲一二三四区视频 | 久久久观看| 日韩成人小视频 | 免费网站观看www在线观 | 99精品欧美一区二区三区 | 亚洲黄色三级 | 日韩av在线免费播放 | 国产毛片在线 | 亚洲视频在线观看一区 | 成人动漫在线播放 | 国产精品久久久久久亚洲调教 | 欧美劲爆第一页 | 久久国产精品久久 | av网站观看 | 夜夜骑夜夜骑 | 日韩中文字幕在线播放 | 日本电影中文字幕 | 亚洲国产一区二区三区, | 黄色精品网站 | 蜜桃精品久久久久久久免费影院 | 黄色三级小视频 | 国产精品久久久一区二区三区 | 一集黄色大片 | 在线看一区二区 | 麻豆视频成人 | 久九九久频精品短视频 | 国产成人在线电影 | 日韩福利在线 | 国产玖玖视频 | 国产伦精品一区二区三区精品视频 | 99国产欧美 | 性欧美精品 | 成人激情视频在线观看 | 美女又爽又黄免费视频 | 狼人综合网 | 国产精品无码永久免费888 |