【发布时间】:2015-08-12 07:21:02
【问题描述】:
我有一个播放 Flash 对象(视频)的 iframe
在它拥有的 iframe 内
<object id="objectId" width="640" height"640" data="name.swf?v=1.2">
</object>
现在我尝试使用 javascript 和 jquery 更改此对象的宽度和高度,但它没有改变!
这是我尝试过的代码
$("#objectId").css({"width":"790px"}) //also tried without px
document.getElementById("objectId").style.width="790"
同样$("#objectId") 在控制台中返回[]
我将此视频嵌入到 div 内的 iframe 中
结构是这样的
<div id="container">
<iframe src="blabla/bla.swf">
<object id="objectId" width="640" height"640" data="name.swf?v=1.2">
</object>
</iframe>
</div>
所以我尝试使用$("#container").html() 访问 div 内的 html
这仅返回 iframe 而不是其中生成的内容!!
【问题讨论】:
-
寻找可行的解决方案!
标签: javascript jquery css flash iframe