Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mopen() {
- if (isOpen == 0) {
- dropDown.style.visibility = 'visible';
- isOpen = 1;
- // add an event listener that closes the menu if the document is clicked
- // document.addEventListener("click", mclose, false);
- }
- else {
- isOpen = 0;
- dropDown.style.visibility = 'hidden';
- document.removeEventListener("click", mclose, false);
- }
- }
- // this function should've been used if the document is clicked anywhere else than on 'Tracks'
- function mclose() {
- if (isOpen == 1) {
- isOpen = 0;
- dropDown.style.visibility = 'hidden';
- document.removeEventListener("click", mclose, false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement