marcelgo
marcelgo

Reputation: 85

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.

Upvotes: 0

Views: 178

Answers (1)

general03
general03

Reputation: 863

$('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

Upvotes: 1

Related Questions