我有一张表与不同的列标识与不同的类。jquery滞后点击功能
我也有一个复选框绑定到每一列。
我创建了一个函数,在点击任何复选框时调用。在这个函数中,我隐藏/显示与此链接的列。
它没有任何JavaScript错误,代码如下:
$(document).ready(function(){
$('ul input').click(function(){
//alert('yooo');
if ($(this).is(':checked')) {
//alert('checked');
$("td."+replaceAll(" ","_",$(this).val())).show();
$("th."+replaceAll(" ","_",$(this).val())).show();
//alert($("td").length);
}
else{
//alert('unselected');
$("td."+replaceAll(" ","_",$(this).val())).hide();
$("th."+replaceAll(" ","_",$(this).val())).hide();
}
});
});
然而,每一次点击后,该操作有一个滞后(许多点击之后就变成tooooooo缓慢,许多秒) 。
我也试着用.css代替隐藏显示,但它没有做任何改变。
你能发布你的html吗? – Unknown
'<? \t \t \t $ d = 0; \t \t \t的foreach($ matriceCampi为$ chiave => $ valore){ \t \t \t \t?> \t \t \t \t \t
AHM可你把生成的HTML它会更容易比服务器端代码来解释。 –