Difference between revisions of "Template:BIMATOX Project"

Line 8: Line 8:
 
document.getElementById(id).classList.toggle("show");
 
document.getElementById(id).classList.toggle("show");
 
}
 
}
 +
 +
$(document).click(function (e) {
 +
    e.stopPropagation();
 +
    var container = $(".dropDown");
 +
 +
    //check if the clicked area is dropDown or not
 +
    if (container.has(e.target).length === 0) {
 +
        $('.subMenu').hide();
 +
    }
 +
})
  
 
// Close the dropdown if the user clicks outside of it
 
// Close the dropdown if the user clicks outside of it
Line 18: Line 28:
 
   }
 
   }
 
}
 
}
 
/* Anything that gets to the document
 
  will hide the dropdown */
 
$(document).click(function(){
 
  $("#dropdown").hide();
 
});
 
 
/* Clicks within the dropdown won't make
 
  it past the dropdown itself */
 
$("#dropdown").click(function(e){
 
  e.stopPropagation();
 
});
 
  
 
</script>
 
</script>

Revision as of 00:32, 28 October 2017