質問

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

役に立ちましたか?

解決

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%;
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top