EasyShop/js/jquery.nav.js
(完整代码) 1KB; (function ($) {
$.fn.extend({
"nav": function (con) {
var $this = $(this), $nav = $this.find('.switch-tab'), t = (con && con.t) || 3000, a = (con && con.a) || 500, i = 0, autoChange = function () {
$nav.find('a:eq(' + (i + 1 === 5 ? 0 : i + 1) + ')').addClass('current').siblings().removeClass('current');
$this.find('.event-item:eq(' + i + ')').css('display', 'none').end().find('.event-item:eq(' + (i + 1 === 5 ? 0 : i + 1) + ')').css({
display: 'block',
opacity: 0
}).animate({
opacity: 1
}, a, function () {
i = i + 1 === 5 ? 0 : i + 1;
}).siblings('.event-item').css({
display: 'none',
opacity: 0
});
}, st = setInterval(autoChange, t);
$this.hover(function () {
clearInterval(st);
return false;
}, function () {
st = setInterval(autoChange, t);
return false;
}).find('.switch-nav>a').bind('click', function () {
var current = $nav.find('.current').index();
i = $(this).attr('class') === 'prev' ? current - 2 : current;
autoChange();
return false;
}).end().find('.switch-tab>a').bind('click', function () {
i = $(this).index() - 1;
autoChange();
return false;
});
return $this;
}
});
}(jQuery));
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。