BKWLD

 

Hide Flash div without restarting movie/applet

By Ben on January 29, 2008 at 4:22 pm

I ran into an issue today with Flash and targeting the div wrapper (when using SWFObject). Basically, there seems to be a bug in Firefox (and possibly other browsers) that causes the applet to reload when changing its display state. I found that instead of using

document.getElementById('flash_div').style.display = 'none';

that by using an explicit dimension you can achieve the same result without restarting the applet:

document.getElementById('flash_div').style.height = '0px';

Not sure if Firefox 3 addresses this. I’m guessing it does.

EDIT

ARGH. Setting the height to 0 definitely hides it, but little pieces of the flash are still active. Guess it’s an official “bug.”

3 Comments »

  1. Have you tried visiblity = “hidden”; ?

    I think we dealt with this on paigehemmis.com a little bit… How did you end up resolving this?

    Comment by Jordan — February 20, 2008 @ 11:48 pm

  2. Fixed this problem by have a floating div which the flash object replaces using SWF. Then just set the height of the object every time I wanted to show or hide. Works perfect

    Comment by Jack — December 14, 2008 @ 4:34 pm

  3. well, hi admin adn people nice forum indeed. how’s life? hope it’s introduce branch ;)

    Comment by cwxwwwxdfvwwxwx — December 25, 2008 @ 2:33 am


RSS feed for comments on this post. | TrackBack URI

Leave a comment