On 3 nov, 08:14, PhistucK <
phist...@gmail.com> wrote:
> If you add your scrolling code to the onload handler (with a setTimeout),
> does it still not work?
> I would do that, in addition to adding the (same) scrolling code to the
> DOMContentLoaded event. Sounds like it should work (perhaps a small flicker
> will happen, but this is a workaround, after all).
>
I can't do it before I completely reformatted the layout of the page,
since this is what my extension does.
What I do now is:
if (atm0s.geenstijl.mozilla.extension.isFF()) {
this.initializeScrollPosition();
} else //chrome
{
// Restore or set scrollposition
this.scrolled = false;
$(window).scroll(function(e) {
if (!objRef.scrolled) {
setTimeout(function() {
if (!objRef.scrolled) {
objRef.scrolled = true;
objRef.initializeScrollPosition();
}
}, 100);
}
});
setTimeout(function() {
if (!objRef.scrolled) {
objRef.scrolled = true;
objRef.initializeScrollPosition();
}
}, 2000);
}
This makes it work most times, but once in a while it still gets
messed up.