如何在Windows 8.1触摸屏中处理鼠标悬停和mouseleave事件 [英] How to handle mouseover and mouseleave events in Windows 8.1 Touchscreen

查看:126
本文介绍了如何在Windows 8.1触摸屏中处理鼠标悬停和mouseleave事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的asp.net项目中,我编写了关于按钮和其他控件的mouseover和mouseleave/mouseout事件的javascript函数.以前,该网站是在非触摸屏设备上使用的.但是现在当我尝试在Windows 8.1或Internet Explorer 10/11上访问同一网站时,问题是,触摸屏幕后触发了鼠标单击事件(在我的情况下是可以的)并且当我在屏幕上移开手指时,会触发mouseleave事件(这是有问题的,例如,在触发mouseleave事件后,下拉菜单无法正常工作).仅在Internet Explorer 10/11中会出现此问题.该网站在Chrome上的所有功能均正常运行.有没有针对此问题的JQuery插件或其他解决方案?请尽快回复.我非常需要这个.

In my asp.net project, I have written javascript functions on mouseover and mouseleave/ mouseout events of buttons and some other controls. Previously this website was used on non touchscreen devices. But now when I am trying to access the same website on Windows 8.1 , on Internet Explorer 10/11,the problem is, after touching a screen mouse click event is fired (which is ok in my case)and when I remove finger on screen, mouseleave event is fired (which is problematic e.g. dropdowns are not working properly after mouseleave events fired). This Problem arises only in Internet Explorer 10/11. And the site is working fine with all its functionality on Chrome. Is there any JQuery Plugin or some other solution for this problem? Please reply soon. I need this very urgently.

先谢谢了.

推荐答案

向显示/隐藏元素触发下拉菜单添加aria-haspopup="true"属性. https://msdn.microsoft.com/zh-cn/library/ie/jj152135(v = vs.85).aspx

Add aria-haspopup="true" attribute to element triggering dropdown showing/hiding. https://msdn.microsoft.com/en-us/library/ie/jj152135(v=vs.85).aspx

这篇关于如何在Windows 8.1触摸屏中处理鼠标悬停和mouseleave事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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