FruitNotes beta
Your All-in-One Online Notebook
FruitNotes Blogs | Home  
Flash Object And Z-Index: How To Make Them Play Nicely Together
Last updated at (Thu Jan 10 2008 11:47:17)
Posted by: Nitin Gupta
0%




Article explains how to make flash and pop-div work properly, resolving z-index issue

http://manisheriar.com/blog/flash_objects_and_z_index

 

Flash Object And Z-Index: How To Make Them Play Nicely Together

I’m currently working on a site with the wonderful Hong Vo from Namaste Interactive that has an embedded flash video object on the home page. This site also has a horizontal drop-down menu. All was great until one of the drop down lists became long enough to overlap the flash video. Apparently, when embedding a flash video into an html page the embed code automatically puts the flash video on top of everything else. I could not for the life of me get the menu to lay behind the video no matter what I tried.

It was one of those “little problems” that was eating away my entire morning and most of my patience! ;o) In sadness, I discovered several forum discussions in which, apparently, it was agreed that there was simply nothing to be done.

Thankfully, I was stubborn and continued to dig further (I don’t give up easily!) and found this discussion, which contained a simple solution, which I will summarize for you:

  1. Wrap your flash content in a div
  2. Add <param name=”wmode” value=”transparent”> to your object tag
  3. Set wmode=”transparent” in the embed tag
  4. Use css to set the position and z-index for your div (don’t set negative z-index values as it will make your flash disappear)
The CSS

#flash {
  position: relative; /*or absolute*/
  z-index: 0;
}

The XHTML

<div id="flash">
  <object .… >
    <param name="wmode" value="transparent">
    <embed .… wmode="transparent">
  </object>
</div>

And that’s it!

 


Rate this blog

   Report Abuse


Comments


From Jeremy Carlson at Fri Aug 14 2009 16:54:39 GMT-0600 (MDT)

Thanks so much - I was having this very problem in IE6 and this fixed it. Smile

While trying to clean up my code I tried applying the position: relative and z-index directly to the object in CSS, like this:

object { position: relative; z-index: 0 }

And it seems to work! I haven't tested this thoroughly yet, but hope this helps someone out, too.

-Jeremy



-----------
From Jeremy Carlson at Fri Aug 14 2009 16:54:22 GMT-0600 (MDT)

Thanks so much - I was having this very problem in IE6 and this fixed it. Smile

While trying to clean up my code I tried applying the position: relative and z-index directly to the object in CSS, like this:

object { position: relative; z-index: 0 }

And it seems to work! I haven't tested this thoroughly yet, but hope this helps someone out, too.

-Jeremy



-----------
From Jen Rasmussen at Wed May 20 2009 09:30:09 GMT-0500 (Central Daylight Time)

Hi i am running across this same issue but can't seem to get the fix to work.

Here's my relevant code:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="600" height="360">
    <param name="wmode" value="transparent" />
    <param name="movie" value="/swf/Arrangements-050709.swf" />
    <param name="quality" value="high" />
    <embed src="/swf/Arrangements-050709.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="360"></embed>
  </object>

 CSS:

div.flash {
position:relative;
z-index:0;
}

div.menu {
width:800px;
position:relative;
z-index:1;
}

 Thanks much!



-----------
From Ryan May at Thu Mar 12 2009 12:04:14 GMT-0700 (Pacific Daylight Time)

Gupta..  You are the man..

 This saved probably 2 days of frustration.  Thanks for publishing it in a clean and easy to understand manner.

 Lifeyo.com

 



-----------

Leave your comment(s) below:
To start Your own Blog




Other Blogs
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
» 
2007 FruitNotes.com - All Rights Reserved.