Firstly, there is an error in your published code. If you intend to use a common template string is neither null nor empty nor '#', this should be:
if (window.location.hash && window.location.hash != "#")
window.scrollBy(0,-60);
However, since Location.hash is well supported, the code above should work on all modern browsers.
source
share