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