简体   繁体   English

动态更改SWF的宽度和高度

[英]Change the width and height of a swf dynamically

I'm trying to use the following js to change the width and height of a swf. 我正在尝试使用以下js更改swf的宽度和高度。

$('object').attr({'width':100,'height':100});
$('object embed').attr({'width':100,'height':100});

The script works well on firefox, safari, IE8. 该脚本在Firefox,Safari和IE8上运行良好。 However, it doesn't work on IE7. 但是,它在IE7上不起作用。

Is there any solution? 有什么解决办法吗?

How about with 怎么样

$('object, embed')
    .attr({'width':100,'height':100})
    .width(100).height(100);

How about wrap the Flash with a div. 如何用div包装Flash。 Set the Flash to 100% height and width. 将闪光灯设置为高度和宽度的100%。 And then you resize the div instead? 然后您改为调整div的大小?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM