tabBody.stop(true,true).fadeIn(opts.fadeIn);
tabs.stop(true, true).removeClass(opts.className);
li.stop(true, true).addClass(opts.className);
}
}
function ajax(div, li) {
var href = li.find("a").attr("href");
var rel = li.find("a").attr("rel"); //ajax请求url
var i = div.filter(href); //当前div
if (rel) { //如果ajax请求url不为空,只ajax一次
i.html(opts.loadName);
$.ajax({
url: rel,
cache: false,
success: function (html) {
i.html(html);
},
error: function () {
i.html('加载错误,请重试!');
}
});
li.find("a").removeAttr("rel"); //只ajax一次
}
}
if (opts.autoFade) {
var index = opts.firstOn + 1;
setInterval(function () {
if (index >= div.length) {
index = 0;
}
tabsShow(div, $(this), index++);
}, opts.autoFadeTime * 1000);
}
tabs.bind(opts.eventName == 'all' ? 'click mouseover' : opts.eventName, Tabs) //绑定事件
.filter(':first').trigger(opts.eventName == 'all' ? 'click' : opts.eventName); //自动触发事件
});
};
})(jQuery);










