i’ve got a site with the usual syntax (header, main, footer).
I got a subnavigation in my main section.
My Problem:
The subnavigation has the id #nav_sub. If the pages “imprint”, “contact” or “newsletter” has been loaded, my CMS (Contao) is adding the class “footerstyle” in the body-tag, looking like this:
<body class="mac chrome ch24 footerstyle">
For the subnavigation I’m adding a nice hover effect BUT I don’t want this effect on the subnavigation when “footerstyle” is loaded. Is this somehow possible?
This is how I select the subnavigation:
var $subnavi = jQuery("#nav_sub #navigation");
I tried :not and .not() but It hasn’t worked.
Thank you very much for your help
Supposing your existing selector
"#nav_sub #navigation"is correct (the element with idnavigationif it’s inside an element with idnav_sub), then you might useor
If you don’t have special condition about #navigation being in #nav_sub, simply use