How to prevent with jQuery default browser behavior, jump to anchor if anchor is in the link when page loads?
var myLink = document.location.toString();
if (myLink.match('#')) {
$('html, body').animate({ scrollTop: 0 }, 0); // OR
$(window).scrollTop();
}
Or…. can’t find solution… searched… and searched
use return false / event.preventDefault on your links
Or do you mean that you want o smooth scroll to the position of the ID you are refering to in your hash sign?
after reading your comments ignore this message.
maybe like this: http://jsbin.com/ajafor/4#hello