Guest User

Untitled

a guest
Oct 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. // Close the dropdown menu if the user clicks outside of it
  2. window.onclick = function (event) {
  3. if (!event.target.matches('.bulk-dropbtn')) {
  4.  
  5. var dropdowns = document.getElementsByClassName("bulk-dropdown-content");
  6. var i;
  7. for (i = 0; i < dropdowns.length; i++) {
  8. var openDropdown = dropdowns[i];
  9. if (openDropdown.classList.contains('show')) {
  10. openDropdown.classList.remove('show');
  11. }
  12. }
  13. }
  14. }
Add Comment
Please, Sign In to add comment