开发者

Swf causing overflow [duplicate]

开发者 https://www.devze.com 2023-03-30 05:23 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Why is my swf taking up more space than it actually is?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Why is my swf taking up more space than it actually is?

I've embedded a short flash animation in my HTML. The swf sits inside a div called mainspace which sits inside another div called container. The mainspace div has a padding of 10px on all sides, changing its total area from 640x500 to 620x480. The swf is 620x480, but, strangely, it is causing an overflow and scrollbars to appear in Firefox (but not IE).

Here's the HTML:

<div class="mainspace">

<object type="application/x-shockwave-flash" data="images/indexslideshow.swf" width="620" height="480">

&开发者_JAVA百科lt;param name="movie" value="indexslideshow.swf"/>

<param name="wmode" value="transparent"/>

<a href="http://www.adobe.com/go/getflash"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/></a>

</object>

</div>

And here's the CSS

.mainspace {
width:620px;
height:480px;
overflow:auto;
position:absolute;
text-align:left;
margin:0px 0px 0px 160px;
padding:10px;
z-index:1;
}

.mainspace img {
border:none;
}

.imglinks1 {
margin-left:auto;
margin-right:auto;
width:50px;
border:none;
z-index:2;
}

.imglinks2 {
margin:0 0px 0 0px;
float:left;
border:none;
z-index:3;
}

body .mainspace {

}

.mainspace p {margin:0px 0 14px 0;}

.mainspace h1 {margin-left:10px; font-size:18px; color:#56AD3D; clear:both;}
.mainspace h2 {margin-left:10px; font-size:15px; color:#56AD3D; clear:both;}
.mainspace h3 {margin-left:30px; font-size:15px; color:#56AD3D;}
.mainspace h4 {margin-left:40px; font-size:15px; color:#56AD3D;}
.mainspace h5 {font-size:16px;}
.mainspace h6 {font-size:16px;}

.mainspace a:link {color:#E0D3C6; text-decoration:none;}
.mainspace a:visited {color:#56AD3D; text-decoration:none;}
.mainspace a:hover {color:#56AD3D; text-decoration:none;}

The imglinks divs have nothing to do with this page, and, if anyone can tell me how to fix this while keeping it XHTML Strict, I would be enormously grateful.


Try this method to embed your swf object. It has several user friendly features.

You can download your swfobject javascript calss from here


<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
    var flashvars = {};
    var params = {};
    var attributes = {};   
    swfobject.embedSWF("indexslideshow.swf", "mainspace", "300", "120", "9.0.0", false, flashvars, params, attributes);
</script>


overflow-x: none;
overflow-y: none;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号