views:

870

answers:

2

Is there any sort of workaround for the bug that makes firefox flicker when decreasing the size of the document?

Click here for a demo

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

+2  A: 

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);
yuval
The scrollTo plugin ended up being the only real workaround for me. Somewhere else I saw a suggestion to do overflow:hidden, then change it back to auto, but that has never worked for me.. too bad, because that sounds like the best possible fix.. Thanks!
Stephen J. Fuhry
anytime! glad to help.
yuval
I went to your demo and in Firebug added overflow:hidden to the body tag. No flicker. That doesn't work for you?
mwilcox
Yes, overflow:hidden removes the flicker -- but unfortunately it also removes the overflow :-p
Stephen J. Fuhry
+1  A: 

It seems that today I diagnosed the source of this problem.

The test page is here http://edren.fatal.ru/storage/firefox-flicker-bug.html

I'm going to post a bug report to Mozilla...

amartynov