Opera在禁用的输入元素上触发鼠标事件 [英] Opera firing mouse events on disabled input element

查看:133
本文介绍了Opera在禁用的输入元素上触发鼠标事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图像元素,以下是按钮的html

I have an image element, following is the html for the button

<input type="image"src="images/undo.png" onmouseover="this.src='images/undo-hover.png'" onmouseout="this.src='images/undo.png'"  id="btn_back" onClick="back();" >

当我的应用程序禁用此输入(属性禁用=禁用)所有浏览器停止触发鼠标事件。所以我没有悬停的图像。但歌剧仍然不断发射这些事件,我不断地将停止的图像放在残疾元素上。

When my application makes this input disabled (attribute disabled="disabled") all browsers stop firing mouse events. So I don't get hover images. But opera still keeps firing these event, and I keep getting the hover images on disabled elements.

推荐答案

您可以尝试在默认情况下禁用INPUT元素(从INPUT标签中添加禁用=禁用) 。然后看看Opera是否仍然响应鼠标悬停。这可能不会立即解决问题,但有助于找出原因。

Can you please try making the INPUT element disabled by default (add disabled="disabled" in the INPUT tag from start). Then see if Opera is still responding to mouse hover. This may not fix the issue right away but will help in figuring out the cause.

另外,另一种方法可能是在鼠标事件上调用JS函数,并检查元素被禁用或不被禁用。如果它被禁用,那么不要更改src属性。

Also, another approach could be to call the JS function on mouse event and check if the element is disabled or not. If it is disabled then dont change the src attribute.

HTH,

这篇关于Opera在禁用的输入元素上触发鼠标事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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