Open limodou opened 12 years ago
The reason heading positions are cached is for performance. Every offset() call does a reflow on the document. I'll look into the other two changes.
I know what you mean. But in my case some sections may have images or the content may be changed dynamically, so I found the positions are not right when I scrolling the page, so I calaulate the position dynamically. Hope this will be helpful.
For hash option, I found when I click the link in the toc, it'll scroll to the position of related heading, but sometimes it'll "jump back a bit" then, and when I try to comment the code:
location.hash = elScrollTo;
It seems good. So I think maybe there is something wrong with it.