这是个选项卡功能
我下面的100毫米感觉要等一秒多后才出来,应该是点击先循环清除的原因,这里要花时间,这个要怎么样避免?
如果不先清理又不行,有没有其它方面
$(document).delegate("span[class=tabsel]", "click", function() {
//先循环清除所有
$(".tabsel").each(function() {
$(this).data('fadeOut', false);
$(this).removeClass("hoverbg");
$(".shade").remove();
$(".accessPage footer").animate({
height : "0"
}, 100);
$(".gridtable td").css("cursor", "default");
});
//然后在给当前点击添加
if (!$(this).data('fadeOut')) {
$(this).data('fadeOut', true);
$(this).addClass("hoverbg");
$("body").append("<div class=\"shade\" style='height:"+$(document.body).height()+"px'></div>");
$(".accessPage footer").animate({
height : "0.40rem"
}, 100);
}
});