如何防止 Javascript 菜单隐藏在 Flash 视频 (SWFObject) 下
如何防止 Javascript 菜单隐藏在 Flash 视频 (SWFObject) 下。
我正在使用 Open Flash Chart,图表在我的 php 购物车中显示良好,但我的 javascript 菜单隐藏在 Flash Chart 后面。
如何纠正这个问题?
这是我的脚本代码:
<script type="text/javascript">
swfobject.embedSWF(
"open-flash-chart.swf", "Dashboard_Chart",
"800", "400", "9.0.0", "expressInstall.swf",
{"data-file":"ofc-chart.php"} );
</script>
更新(已解决):
我找到了解决方案。
这是我的新代码,可以正常工作并且菜单显示正常。
<script type="text/javascript">
var flashvars = {};
var params = {};
params.wmode = "opaque";
var attributes = {};
swfobject.embedSWF("../swf/open-flash-chart.swf", "Dashboard_Chart", "760", "300", "9.0.0", "expressInstall.swf", {"data-file":"ofc-chart.php"}, flashvars, params, attributes );
</script>
How to prevent Javascript Menu from getting hidden under Flash Video (SWFObject ).
I am using Open Flash Chart and the chart is displaying fine in my php shoppping cart, but my javascript menu is getting hidden behind the Flash Chart.
How to correct this problem?
Here is my script code:
<script type="text/javascript">
swfobject.embedSWF(
"open-flash-chart.swf", "Dashboard_Chart",
"800", "400", "9.0.0", "expressInstall.swf",
{"data-file":"ofc-chart.php"} );
</script>
UPDATE (Solved):
I found the solution.
Here is my new code which works and the menu shows up fine.
<script type="text/javascript">
var flashvars = {};
var params = {};
params.wmode = "opaque";
var attributes = {};
swfobject.embedSWF("../swf/open-flash-chart.swf", "Dashboard_Chart", "760", "300", "9.0.0", "expressInstall.swf", {"data-file":"ofc-chart.php"}, flashvars, params, attributes );
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将 wmode 参数设置为透明
Try setting the wmode parameter to transparent
您需要将 wmode 设置为不透明(或透明)。 这将渲染委托给浏览器并允许 z-index 元素位于 Flash 内容之上。 示例:
有许多缺点,例如国际化损坏和渲染速度较慢,但它会将 Flash 放在您的菜单下。
You need to set the wmode to opaque (or transparent). This delegates rendering to the browser and allows z-index elements to sit above the Flash content. Example:
Comes with a number of disadvantages, such as broken internationalisation and slower rendering speed, but it will get the Flash under your menu.