Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function(){
- var anchors = document.getElementsByTagName("a");
- var anchorWOHash;
- var locationWOFragment;
- for(var x=0; x<anchors.length; x++)
- {
- if(anchors[x].href.indexOf('#') === -1) continue;
- anchorWOHash = anchors[x].href.split(/#/)[0];
- locationWOFragment = window.location.href.split(/#/)[0];
- if(anchorWOHash === locationWOFragment)
- {
- $(anchors[x]).click(function(e) {
- e.preventDefault();
- scroll('#' + this.href.split(/#/)[1], 400);
- return false;
- });
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement