Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

dropdown hide

$('a.dropdown').on('click', function () {
 $(this).parent().toggleClass('open'); 
});
Comment

dropdown hide

$('body').on('click', function (e) {
 if (!$('a.dropdown').is(e.target) && $('a.dropdown').has(e.target).length === 0 && $('.open').has(e.target).length === 0 ) { 
$('a.dropdown').parent().removeClass('open'); } });
Comment

PREVIOUS NEXT
Code Example
Javascript :: wild card select jquery 
Javascript :: js object to c# object 
Javascript :: list in react native 
Javascript :: javascript addeventlistener pass parameters 
Javascript :: gps nodejs 
Javascript :: online password generator 
Javascript :: how to get bearer token in react 
Javascript :: discord.js setinterval 
Javascript :: es6 spread assign nested object 
Javascript :: javascript switch items in array 
Javascript :: new js 
Javascript :: minified react error #200 
Javascript :: error handling in node.js 
Javascript :: create random password 
Javascript :: javascript fade color 
Javascript :: button click 
Javascript :: map function in js 
Javascript :: detect system dark mode tailwind css 
Javascript :: auto generate component angular 
Javascript :: mongoose populate array of ids 
Javascript :: Check Object Is Instance Of Class 
Javascript :: unshift javascript 
Javascript :: javascript split multiple values 
Javascript :: react portals 
Javascript :: arrow function in es6 
Javascript :: jwt token npm 
Javascript :: array method 
Javascript :: javascript if equal infinity 
Javascript :: vscode react snippets 
Javascript :: ?. js 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =