Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. // Plugin initialization
  2. $(".fs-whatwg").floatingScroll();
  3.  
  4. // Handle checkbox state changes and update floating scrollbar
  5. $(".fs-whatwg-cols").on("change", "input[type='checkbox']", function (e) {
  6. var $checkboxes = $(e.delegateTarget).find("input[type='checkbox']"),
  7. index;
  8. if ($checkboxes.filter(":checked").length) {
  9. index = $checkboxes.index(e.target);
  10. if (index > -1) {
  11. $("#fs-whatwg").find("th, td")
  12. .filter(":nth-child(" + (index + 2) + ")")
  13. .toggleClass("hidden");
  14. }
  15. } else {
  16. $checkboxes.prop("checked", true);
  17. $("#fs-whatwg").find("th.hidden, td.hidden").removeClass("hidden");
  18. }
  19. // Force scrollbar update programmatically
  20. $(".fs-whatwg").floatingScroll("update");
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement