在 Flex 4 中,mouseOut 事件在调整大小后根据旧组件的大小触发?如何避免这种情况?
我有一个名为 X 的组件。当我将鼠标放在它上面时,我试图从它中弹出一个菜单。
我有一个 mouseOver 处理程序,它将组件的状态更改为另一个状态,该状态在下部显示一个额外的子组件(菜单)。这当然会让X组件增长。
我还有 mouseOut 事件处理程序,它通过将组件 X 返回到其原始状态来使菜单消失。
当我将鼠标移到组件上时,菜单将按预期显示。但是,当我将鼠标向下移动到现在可见的菜单时,只要我触摸它,它就会消失。这样就不可能到达菜单。
我猜想一旦我移出旧边界,就会触发 mouseOut 事件。是这样吗?我怎样才能避免它?新的边界现在应该考虑菜单中的额外子项。
提前致谢, 努诺
I have a component called X. I'm trying to make a menu come down from it when I put my mouse over it.
I have a mouseOver handler which changes the component's state to another state which shows an extra child component (the menu) on the lower part. This of course makes the X component grow.
I also have mouseOut event handler which makes the menu disappear by returning component X to its original state.
When I move the mouse over the component the menu appears as expected. But when I move the mouse down to the menu that is now visible, as soon as I touch it, it disappears. This way it's impossible to reach the menu.
I guess the mouseOut event is triggered as soon as I move out of the old boundaries. Is this so? And how can I avoid it? The new boundaries should now consider the extra child with the menu.
Thanks in advance,
Nuno
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您将鼠标移到子元素上时,您将鼠标移出组件“X”。
如果没有看到代码,我真的无法帮助你。但是您可能想尝试一些事情。
鼠标和组件的并且仅
如果事件通过,则调度该事件
仅当鼠标不在您的上方时才将其移出
成分。您的组件不应仅因为鼠标移出组件而调度鼠标移出事件
但实际上,如果没有代码,我无法提供更多帮助。
When you move over the child element you are mousing out of compo0nent "X".
Without seeing code I can't really help you. However you might want to try a few things.
of the mouse and component and only
dispatch the event if it passes a
mouse out only if it isn't over your
component. Your component shouldn't dispatch a mouse out event just because the mouse moved out of the component
But really there is no way I can help more without code.