My navigation highlights the section of the page the visitor is on and changes as they scroll by adding .active-nav to ANY href that points to that section of the page. I have an image sprite that points to #foo but I don't want .active-nav added to that anchor tag. I am having no luck implementing the :not selector. I fear I have spent too much time on this and cannot see the obvious answer.
I would like to have the following code ignore an href tag if a specific class (.bar) already exists. Please advise.
if ( windowpos > $('#foo').offset().top) {
$('nav li a').removeClass('active-nav');
$('a[href$="#foo"]').addClass('active-nav');
}