图片按钮单击事件中铬不触发 [英] Image button click event not firing in chrome

查看:113
本文介绍了图片按钮单击事件中铬不触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,在Chrome中,如果你有一个asp.net图像按钮,做一个鼠标按下然后鼠标移动,最后鼠标时,将不会触发click事件。它工作在其他浏览器。是否有任何身体周围有一个工作,这???

I noticed that in chrome if you have an asp.net image button and do a mouse down then a mouse move and finally a mouse up, a click event is not fired. It works in other browsers. Does any body have a work around to this ???

推荐答案

这是因为镶边时,你这样做,开始选择/拖动行为。试试下面的CSS。

It's because chrome starts a select/drag behavior when you do that. Try the following css.

html, body, div, span, object, form, input, h1, h2, button, label, a, img
{
    -moz-user-select: none;
    -webkit-user-select: none; /* this will work for QtWebKit in future */
    -webkit-user-drag: none;
}

这篇关于图片按钮单击事件中铬不触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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