【发布时间】:2011-05-22 11:39:35
【问题描述】:
我想知道是否可以使用 javascript 调整 Flash 的大小。我无法单独更改 flash 对象中的任何代码,我只能使用 html、javascript 和 php。
这是我目前发现的:
var changeMe = document.getElementById("content_embed");
changeMe.height = yy;
changeMe.width = xx;
if (navigator.userAgent.toLowerCase().indexOf("safari")!=-1) {
var changemeObject = document.getElementById("content_object");
changeMeObject.height = yy;
changeMeObject.width = xx;
}
}
Content Embed 是嵌入标签,content object 是flash 中的object 标签。这适用于chrome(可能还有firefox),但不适用于ie。
在 Internet Explorer 中出现错误:Unable to set value of the property 'height': object is null or undefined
这是我一直在使用的示例页面:http://futuregamespc.com/behind/Popup/
任何人都可以帮忙吗?谢谢大家,是你们让这个网站变得很棒。
【问题讨论】:
-
尝试使用 jquery 抽象出所有浏览器特定的代码。
-
futuregamespc.com/behind/Popup/index2.html 会这样做,但它在 chrome 或 Internet Explorer 中不起作用,而且很奇怪,它不会返回任何错误,只是不起作用。
标签: javascript flash internet-explorer