wmode="opaque" 的问题和 wmmode="window" 的问题; [英] Issues with wmode="opaque" and issues with wmmode="window"
问题描述
好的,首先我遇到了window"的默认 wmode 两个问题.我的网页导航菜单将位于我的 flex/flash 应用程序下.另一个问题是在 Flash 应用程序中滚动时,整个页面都会滚动.
我将 wmode 更改为不透明",这解决了导航菜单的问题,现在它们显示在 Flash 应用程序上方.太好了,但现在我根本没有在 Flash 应用程序中滚动.
我意识到这是一个大问题,但我似乎无法找到解决这两个问题(实际上是 2.5 个问题)的任何解决方案.
我想 A) 在 Flash 应用程序上方显示导航链接,这样它们就不会被隐藏;B) 允许在 Flash 应用程序内滚动;和 C) 如果鼠标悬停在 Flash 应用上,则防止滚动网页.
如果你们有任何想法,那就太棒了.:) 提前致谢.
我写的意思:
<块引用>wmode=transparent &wmode=opaque 的行为与鼠标滚轮相同.
是这两种模式都不会在大多数浏览器中捕获 Flash 中的 MOUSE_WHEEL
事件(我相信 IE 是唯一正确捕获 MOUSE_WHEEL
事件的浏览器).>
解决方案是通过 JavaScript 监听 MOUSE_WHEEL
事件:
//ie 正确处理 wmode=transparent//所有其他浏览器都使用 addEventListener如果(!document.attachEvent){//console.log('附加');window.addEventListener('DOMMouseScroll', scrollListener, false);window.addEventListener('mousewheel', scrollListener, false);}滚动监听器( e ){无功增量如果(e.wheelDelta){delta = e.wheelDelta/40;}否则如果(e.detail){delta = -e.detail;}//用delta做一些事情}
然后您需要使用 ExternalInterface.addCallback
为 JS 设置回调,以提醒 Flash 发生了 MOUSE_WHEEL
事件.
wmode=transparent
&wmode=opaque
其他鼠标事件也有问题.
Ok so first I was having 2 issues with default wmode of "window". My web page navigation menus would go under my flex/flash app. The other issue was when scrolling in the flash app the whole page would scroll.
I changed wmode to "opaque" and this fixed the issue with the navigation menus and so now they show up above the flash app. Thats great but now I dont have scrolling at all in the flash app.
I realize this is a big issue out there but I can't seem to find any solutions for solving both(actually 2.5 issues) of these problems.
I would like to A) Have navigation links show up above the flash app so they aren't hidden; B) Allow scrolling within the flash application; and C) Prevent scrolling of the web page if the mouse is over the flash app.
If you guys have any ideas that would be fantastic. :) Thanks in advance.
What I meant when I wrote:
wmode=transparent & wmode=opaque behave the same as far as mousewheel.
is that both modes do not capture the MOUSE_WHEEL
event in flash in most browsers (I believe IE is the only browser to capture the MOUSE_WHEEL
event properly).
The solution is to listen for the MOUSE_WHEEL
event via JavaScript:
//ie handles wmode=transparent correctly
//every other browser uses addEventListener
if ( !document.attachEvent )
{
//console.log('attached');
window.addEventListener('DOMMouseScroll', scrollListener, false);
window.addEventListener('mousewheel', scrollListener, false);
}
scrollListener( e )
{
var delta
if ( e.wheelDelta )
{
delta = e.wheelDelta / 40;
}
else if ( e.detail )
{
delta = -e.detail;
}
//do stuff with delta
}
You'll then need to use ExternalInterface.addCallback
to set up a callback for JS to alert flash that a MOUSE_WHEEL
event took place.
wmode=transparent
& wmode=opaque
have issues with other mouse events as well.
这篇关于wmode="opaque" 的问题和 wmmode="window" 的问题;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!