Accessibility

CSS Advisor

overflow set to hidden value in DIV tag not working when wraps an OBJECT tag that loads flash

by barleby_sp on October 10, 2008 Avg Rating 1.0 (1)   |   Log in to rate post.

Tagged with object , overflow , firefox 3 , auto , div , hidden , firefox 2

Problem

trying to hide part of an <object> tag that loads flash content (when using a wrapping <div> smaller in height than the object flash) results in no hidding at all. Affected browsers: Firefox 2.x and Firefox 3.x

Solution

overflow must be set to auto, instead of hidden using any browser hack to distinguish I.Explorer from Firefox code

Detailed description

<head>
<title>none</title>
<style type="text/css">
.estilo {overflow:auto;}
.estilo {*overflow:hidden;}  /* the wildcart hack for Internet Explorer 6 and 7 */
</style>
</head>

<body>

<div class="estilo" id="miflash" style="height:9px;border:#FF0000 thin solid;">
<!-- notice div heigh is smaller than flash object 'cause we want to hide some part of the flash movie -->

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" width="107" height="40">
<param name="movie" value="mymovie.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">

<embed src="mymovie.swf" quality="high" bgcolor="#FFFFFF" width="107" height="40" type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>

</object>

</body>

<!-- in this example you'll be correctly hidding part of a flash content which is 40px height. Using a <DV> to wrap with overflow (set to either auto or hidden
depending on the browser) will correctly render in FF and IE showing only 9px of the flash movieclip -->
 

 

Related files for download


example.html




Tagged with object , overflow , firefox 3 , auto , div , hidden , firefox 2

Tag it on del.icio.us or Digg

Text ID: OVERFLOW_SET_TO_HIDDEN_VALUE_IN_DIV_TAG_NOT_WORKING_WHEN_WRAPS_AN_OBJECT_TAG_THAT_LOADS_FLASH



Comments (1)

To add a comment, please Log in.




Not working as expected

It clips the flash object, but shows scroll bars, these cover parts of the flash, so it isn't the desired solution. Is there a fix or a work around that makes the DIV some sort of mask as IE and Chrome?





CSS Advisor home
Submit a post

rss

CSS ADVISOR RSS FEEDS
Recent: POSTS | COMMENTS | EDITS


Browsers
Internet Explorer (45)
Mozilla/Firefox (16)
Opera (7)
Safari (13)
CSS Properties
Background (6)
Border (3)
Color (1)
Float (15)
Font (1)
Margin (6)
Padding (4)
Position (15)
Text (13)
Width/Height (9)