简体   繁体   中英

Zurb Foundation Top Bar & jQuery - check if mobile navigation is active

How can I check with jQuery or JavaScript, if Foundation's top bar mobile Navigation (dropdown) is currently active?

I'd like to check it when resizing a window. In the moment when it switches to mobile and back.

$('nav[role=navigation]').find('section li.has-dropdown li').hasClass('active')

You choose the nav tag which has the attribute role to navigation . Inside this, take all the children li which have the class active and which are contain in the li with the class has-dropdown

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM