I just can't figure out this problem.
The circumstances:
Website (Wordpress with Genesis and Altitude-Pro theme) with 4 pages with anchor-sections on it.
The problem:
If a link got clicked it loads the url with the hash (.../#section1) but it is not on the correct position. After hitting enter in the URL it jumps to the correct position.
I think this is because of Images that are loaded and the site jumps to the location before that.
What I tried:
I used this code, but it doesn change anything:
$( window ).load(function() {
alert("LOADED");
hash = document.location.hash;
alert(hash);
if (hash !="") {
setTimeout(function() {
if (location.hash) {
window.scrollTo(0, 0);
window.location.href = hash;
}
}, 1);
}
else {
return false;
}
});
Here's the link to the Demosite -> DEMOSITE