Pregunta

I want to make a scroll effect, so that the website changes the <a href="#" class="active"></a> to the right link while scrolling. (Example: http://callmenick.com/lab-demos/7-single-page-smooth-scroll/)

However I want to exclude one element, which refers to another website (Actually it is a dropdown with some external links). In the following jsfiddle the problem shows up. The point "Exclude" should just be skipped and not mentioned by the script. Is there any easy solution for that?

http://jsfiddle.net/Dxtyu/332/


Source of jsfiddle: Change navigation active class on window scroll

¿Fue útil?

Solución

Check this Updated jsFiddle

If you do not want that external link then why you not remove "Exclude" link, Remove this HTML from your existing Code,

<li><a href="#exclude" class="exclude">Exclude</a>
</li>

Updated jsFiddle

HTML

<div id="exclude"></div>

CSS

#exclude {
   background-color: yellow;
   height: 100%;
   width: 100%;
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top