Firefox Flicker Bug
-
06-07-2019 - |
Question
Is there any sort of workaround for the bug that makes firefox flicker when decreasing the size of the document?
Click here for the demo in quirks mode (no DOCTYPE)
I bet it could be fixed using javascript -- whenever the scrollbar shrinks, make sure to scroll the window up to prevent the flicker or something.. thoughts?
Update: the bug does not appear to be present (or at least not as severe) in quirks mode
Solution
Do this: The problem is that the page scrolls as the image gets resized.
Solution one: Include the jQuery library and jQuery Scroll plugin. Then scroll to the image by doing the following:
$.scrollTo("#image", "fast", function(){
//resize image here
});
OR!
simply disable overflow for the container of the image/page temporarily:
$(body).css("overflow", "hidden");
//do resize
//on resize end (after it has finished):
$(body).css("overflow", "auto");
should solve your problem!
EDIT:
I bet it could be fixed using javascript -- whenever the scrollbar shrinks, make sure to scroll the window up to prevent the flicker or something.. thoughts?
Yes!
//before resizing
var scrollInterval = setInterval(function(){
$.scrollTo("#image", "fast");
}, 1);
//do your resizing
//once resizing done
clearInterval(scrollInterval);