wmode =“不透明”的问题并且wmmode =“window” [英] Issues with wmode="opaque" and issues with wmmode="window"

查看:260
本文介绍了wmode =“不透明”的问题并且wmmode =“window”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,首先我有2个问题与窗口的默认wmode。我的网页导航菜单将在我的flex / flash应用程序下。另一个问题是在Flash应用程序中滚动整个页面将滚动。

我将wmode改为不透明,这解决了导航菜单的问题,所以现在它们显示在Flash应用程序之上。这很好,但现在我没有在Flash应用程序的所有滚动。



我意识到这是一个大问题,但我似乎无法找到解决这两个问题的方法(实际上是2.5个问题)。



我想A)导航链接显示在Flash应用程序的上面,所以它们不被隐藏; B)允许在Flash应用程序内滚动;和C)防止滚动的网页,如果鼠标是在Flash应用程序。



如果你们有任何想法,这将是太棒了。 :)

解决方案

我的意思是当我写道:


wmode = transparent&

是两种模式都不能捕捉 MOUSE_WHEEL 事件在大多数浏览器中的闪存(我相信IE是唯一的浏览器正确捕获 MOUSE_WHEEL 事件)。

解决的办法是通过JavaScript来监听 MOUSE_WHEEL 事件:

  // ie处理wmode =透明正确
//每隔一个浏览器使用addEventListener
if(!document.attachEvent)
{
//console.log '附');
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;

//做delta



$ b

你然后需要使用 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 =“不透明”的问题并且wmmode =“window”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆