Sự kiện click thêm và xóa class
Ứng dụng dùng cho menu, click lần 1 display: block, click lần 2 display: none
Ứng dụng dùng cho menu, click lần 1 display: block, click lần 2 display: none
[javascript] !function(t){t.fn.basictable=function(a){var e=function(a,e,n){a.children().each(function(){var a=t(this);if(“”!==a.html()&&” ”!==a.html()||n.showEmptyCells){for(var r=a.index(),i=””,s=0;s<e.length;s++){0!=s&&(i+=”: “);var o=e[s][r];null!=o&&(i+=o.text())}a.attr(“data-th”,i),n.contentWrap&&!a.children().hasClass(“bt-content”)&&a.wrapInner(‘<span class=”bt-content” />’)}else a.addClass(“bt-hide”)})},n=function(a,e){e.forceResponsive?null!==e.breakpoint&&t(window).width()<=e.breakpoint||null!==e.containerBreakpoint&&a.parent().width()<=e.containerBreakpoint?r(a,e):i(a,e):a.removeClass(“bt”).outerWidth()>a.parent().width()?r(a,e):i(a,e)},r=function(t,a){t.addClass(“lctablebt”),a.header||t.addClass(“bt–no-header”),a.tableWrap&&t.parent(“.bt-wrapper”).addClass(“active”)},i=function(t,a){t.removeClass(“bt bt–no-header”),a.tableWrap&&t.parent(“.bt-wrapper”).removeClass(“active”)},s=function(a,e){var n;a.removeClass(“bt bt–no-header”),a.find(“td”).removeAttr(“data-th”),e.tableWrap&&a.unwrap(),e.contentWrap&&(n=a,t.each(n.find(“td”),function(){var a=t(this),e=a.children(“.bt-content”).html();a.html(e)})),a.removeData(“basictable”)};this.each(function(){var o=t(this);if(0===o.length||o.data(“basictable”))return o.data(“basictable”)&&(“destroy”==a?s(o,o.data(“basictable”)):”start”===a?r(o,o.data(“basictable”)):”stop”===a?i(o,o.data(“basictable”)):n(o,o.data(“basictable”))),!1;var l=t.extend({},t.fn.basictable.defaults,a),b={breakpoint:l.breakpoint,containerBreakpoint:l.containerBreakpoint,contentWrap:l.contentWrap,forceResponsive:l.forceResponsive,noResize:l.noResize,tableWrap:l.tableWrap,showEmptyCells:l.showEmptyCells,header:l.header};null===b.breakpoint&&null===b.containerBreakpoint&&(b.breakpoint=568),o.data(“basictable”,b),function(a,n){var r=[];if(n.tableWrap&&a.wrap(‘<div class=”bt-wrapper”></div>’),n.header){var i=””;i=a.find(“thead tr th”).length?”thead th”:a.find(“tbody tr th”).length?”tbody tr th”:a.find(“th”).length?”tr:first th”:”tr:first…