swfobject 与 html 类?
嘿伙计们, 是否有任何参数可以将类名应用于 swfobject?
<script type="text/javascript">
var params = { allowScriptAccess: "always" };
swfobject.embedSWF("http://www.youtube.com/v/j_aFmziaRdU&enablejsapi=1&playerapiid=ytplayer_13", "ytplayer_13", "425", "365", "8", null, null, params);
</script>
这被渲染为
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用属性参数(没有指向该段落的直接链接,请打开链接并搜索“第 3 步:使用 JavaScript 嵌入 SWF”标题),为对象分配 ID 或类。创建对象后,您可以使用
document.getElementById()
来获取该对象。或者使用 CSS 中的#id
或.classname
,就像您期望的那样工作。但请注意:attributes.class
会导致错误(它是保留关键字),您必须使用attributes.styleclass
来设置类名。You use the attributes parameter (there is no direct link to the paragraph, open link and search for "STEP 3: Embed your SWF with JavaScript" headline) to assign an id or a class to the object. You could then use
document.getElementById()
to get the object, once it has been created. Or use#id
or.classname
from CSS, just the way you would expect it to work. Caution, though:attributes.class
would cause an error (it's a reserved keyword), you have to useattributes.styleclass
to set the classname.您可以更改 swfobject.js 文件,然后手动将其添加到此处。或者进行手动嵌入,而不是 SWFObject。另外,通常将 SWFObject 插入到容器 div 中,您还应该能够在那里插入类。
希望这有帮助。我想这就是你问的问题,如果不是,我的错。
You can alter you swfobject.js file, and manually add it there. Or do a manual embed, versus SWFObject. Also, typically SWFObject is inserted into a container div, you should also be able to insert a class there.
Hope this helps. I think that's what you were asking, if not, my bad.