ouyang789987 / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

Fix to avoid vertical scrollbar and white rectangle from appearing during initial flash player test #357

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Upon the page load, at least in current Opera browser, the test object 
would show up in the bottom of the page, producing for a short period of 
time a white rectangle that increases the page height. If originally the 
page is shorter than the viewport, the scrollbar would appear and then 
disappear, while the page contents would shift to the left and back to the 
right, thus producing an irritating flickering effect. To avoid this, I 
suggest adding these four lines in the testPlayerVersion() function 
somewhere around line 196, after var o = createElement(OBJECT):

        o.style.position = 'absolute';
        o.style.left = '0';
        o.style.top = '0';
        o.setAttribute('wmode', 'transparent');

This will make the test object transparent and absolutely positioned at 
0,0 coordinates, which will avoid page height/width alteration. However, 
the object will still be "visible" and not disabled by the browser, as it 
would happen in case of "visibility:hidden" or "display:none". This is 
tested and works for me in all browsers.

Additionally and optionally, just in case some styling of SPAN elements on 
the page would provide a similar situation during DOM check, I suggest in 
callDomLoadFunctions() function to create the SPAN and set its 'display' 
style property to 'none' before appending to the BODY, for example like 
this:

            var newEl = document.createElement("span");
            newEl.style.display = 'none';
            var t = doc.getElementsByTagName("body")
[0].appendChild(newEl);

instead of just appending a generic SPAN to the BODY.

Hope this helps to make your great piece of software better!

Thank you,
Michael.

Original issue reported on code.google.com by mich...@bunkin.ru on 4 Aug 2009 at 8:01

GoogleCodeExporter commented 9 years ago

Original comment by bobbyvandersluis on 5 Aug 2009 at 7:01

GoogleCodeExporter commented 9 years ago
Thank U!

Original comment by Zyuzin.V...@gmail.com on 29 Jan 2010 at 7:30

GoogleCodeExporter commented 9 years ago

Original comment by platelu...@gmail.com on 20 May 2011 at 11:28

GoogleCodeExporter commented 9 years ago
Issue 468 has been merged into this issue.

Original comment by platelu...@gmail.com on 1 Jun 2011 at 4:30

GoogleCodeExporter commented 9 years ago
Changed solution to use CSS visibility: hidden rather than wmode transparent 
and position: absolute.

Original comment by platelu...@gmail.com on 1 Jun 2011 at 4:31