1
我有弹出窗口th
中的子元素。当我点击.show_history
div显示弹出格.show_history_ctn
时,触发该列的排序。我已将.show_history
的Z-index增加到9999,并且仍然会触发排序。我还将stopPropagation添加到.show_history
点击事件,并且仍然发生排序。jQuery tablesorter子元素th禁用排序
jQuery的
$(".show_history").on("click",function(event) {
$(this).siblings(".show_history_ctn").find("tr").show();
event.stopPropagation();
if($(this).hasClass("active")) {
$(this).siblings(".show_history_ctn").slideUp();
$(this).removeClass("active");
} else {
$(".show_history_ctn").hide();
$(".show_history").removeClass("active");
$(this).siblings(".show_history_ctn").slideDown();
$(this).addClass("active");
}
});
$(".tablesorter").tablesorter();
HTML
<table class='tablesorter'><thead><tr><th><div class='show_history'>Show History</div><div class='show_history_ctn' style='display:none'>**content**</div></th><th></th></tr></thead></table>
我该怎么解决?我需要对列进行排序,否则我只需添加sorter:'false'
。
我试了演示,点击弹出链接仍然被忽略,列被排序。 – mdnba50
糟糕,抱歉..我已经更新了我的答案。 – Mottie