鼠标“向下/向上”和“进入/离开”与透明 Flash 对象重叠的按钮的样式
我有一个 Flash 对象,其尺寸和位置与 HTML 按钮相同。该按钮位于 Flash 对象下方。我希望当单击并悬停 Flash 时,该按钮的样式就像同时单击并悬停一样。
我试图
ExternalInterface.call("mouseEventHandle", elementId, eventName);
在 Flash 中调用:将事件传递给 JS。
在 JS (coffeescript) 中:
window.mouseEventHandle = (elementId, eventName) ->
id = '#' + elementId
switch event
when "down" then console.log("down")
when "up" then console.log("up")
when "enter" then console.log("enter")
else console.log("leave") # leave
该函数负责设置 HTML 按钮的样式。
问题是如何在JS中设置按钮的样式?或者还有其他方法可以达到目的吗?
I have a Flash object which dimension and position are as same as the HTML button. The button is under the flash object. I want when the Flash is clicked and hovered, the button has the styles as if it is clicked and hovered at the same time.
I am trying to call:
ExternalInterface.call("mouseEventHandle", elementId, eventName);
in Flash to pass event to JS.
And in JS (coffeescript):
window.mouseEventHandle = (elementId, eventName) ->
id = '#' + elementId
switch event
when "down" then console.log("down")
when "up" then console.log("up")
when "enter" then console.log("enter")
else console.log("leave") # leave
the function is responsible for styling the HTML button.
The question is how to style the button under in JS? Or is there other way to achieve the goal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终使用了jquery按钮:
所以处理函数看起来像:
返回“false”允许浏览器快速反应。
I finally use jquery buttons:
so the handler function looks like:
returning "false" allows browsers have quick reaction.