In my page I have a header DIV, a link and a target DIV. The link loads – through jQuery load() – a picture in the target DIV.
Problem : if you scroll a bit down AND THEN click on the link, you’ll see that the window scroll position resets to zero. Yet it’s an Ajax event, the scroll position should remain exactly the same !
Note that this is true only the first time you click. If you reload the page and click again, the picture will load without scroll position changing (normal behaviour). You have to clean your browser cache if you want to replicate the problem again.
Any idea of what’s going on here ?
It’s because your target div changes it’s size depending on its child.
If for example you set the height of your
targetto866px(the height of the image) and set the height of your child div to something smaller (at the moment its1000px), you shouldn’t experience these problems (at least I don’t have this problem anymore under Chrome)