Created
January 26, 2017 13:55
-
-
Save MeanEYE/e88c57801ddfec83d496f4dd73a57206 to your computer and use it in GitHub Desktop.
Exclusive node class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var list = document.querySelectAll('a'); | |
function handle_click(event) { | |
event.preventDefault(); | |
for (var i=0, count=list.length; i<count; i++) { | |
var link = list[i]; | |
if (link === this) | |
continue; | |
link.classList.remove('active'); | |
} | |
this.classList.add('active'); | |
this.nextNode().scrollIntoView(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment