About

Labels

slider

Navigation

Customize the element in drop down menu which have child element using Jquery and CSS

Customize the element in drop down menu which have child element using Jquery and CSS

Jquery,really makes easy to work with scripts,and the updates in it's api is really impressive,hence this trick is very easy in which you do not have to add any class in the parent element (which contain child elements) in the listing.But it will be added by using Jquery and you can customize accordingly.
Check the pen below to see the effect
In the above pen you can see that the parents have the plus (+) and when you hover on it,the plus become minus (-) this is the simple example of what I want to show.

The method I've used is .has() function that decrease the set of matched elements that have ul as a child element in it.Then,.addClass() to add a specific class in the set of matched elements.
Share
Banner

Muhammad Hamza

Themelet provides the best in market today. We work hard to make the clean, modern and SEO friendly blogger templates.

Post A Comment:

0 comments: