IE的bug,点击div无效

1 IE6/7/8/9/10中,如果给空a标签定义了宽度和高度且使用了display:block/inline-block,则点击无效。

找到了两种解决方法(主要是针对a标签不能设置背景情况):

1) 给a标签添加样式:background:url(about:blank); 经测试该方法在ie9/10下无效
2) 给a标签随便添加背景色(不能为transparent)或者背景图片,然后将a标签的透明度设置为0,不过在IE中需要使用滤镜,即 opacity:0;filter:alpha(opacity=0);该方法有效

感谢超哥提供解决方案。

我讨厌IE.....

时间: 2024-08-12 23:47:01

IE的bug,点击div无效的相关文章

ios 最新系统bug与解决——微信公众号中弹出键盘再收起时,原虚拟键盘位点击事件无效

最近ios发布新版本系统12.1,随着部分用户的系统更新,一些问题也渐渐暴露出来... 公司用户反映微信公众号出现了点击无效的bug!!测试调查发现,只有iphonex.iphone6,ihpone7等部分机型会出现该问题 我当时就是一惊,一般出现在事件上的问题都是疑难杂症.何况是跟键盘相关的. 我们都知道在H5端是没法监控键盘的弹出与收起的,resize事件触发的机型极其有限,何况我在ios中实测没有触发,安卓反而可以.因为安卓弹起键盘时会修改视窗的大小,但是ios并不会,如果你在ios上设置

js,css随笔(动态生成的dom做点击事件无效)

1.动态生成的DOM做点击事件无效   https://blog.csdn.net/mm_hello11/article/details/79010679 2.消除button的默认样式 margin: 0; padding: 0; border: 1px solid transparent; //自定义边框 outline: none; //消除默认点击蓝色边框效果 3. 键盘按下事件 $("#btn").keydown(function(event){ if(event.keyCo

点击Div,显示其innerHTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-

JQuery实现点击div以外的位置隐藏该div窗口

简单示例代码: <body> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(function(){ $(document).bind("click&

JavaScript点击div来回切换两个颜色及两张图片切换的方法

点击div切换颜色的代码如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .test1{ width:100px; height: 100px; background-color: green; } </style> <

Android 7.0 TextView点击事件无效修复方案

public class PostTextView extends TextView { private Handler handler = new Handler(Looper.getMainLooper()); public PostTextView(Context context) { super(context); } public PostTextView(Context context, AttributeSet attrs) { super(context, attrs); } p

点击div 跳转并通过URL传参

点击div前要先给div绑定要传的参数: //给panel绑定自定义属性,方便在跳转时传带参数,键/值对排列 panel.attr("user_age",user_age); panel.attr("user_name",user_name); panel.attr("user_sex",user_sex); panel.attr('user_problem_dec',user_problem_dec); panel.attr('user_img

jquery点击div 先变大再缩小

<!DOCTYPE html><html>  <head>        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">         <script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>        &l

ListView的item中有button和checkbox,listview的点击事件无效

ListView的item中有button和checkbox,listview的点击事件无效,解决办法: 在item布局文件中的根控件中添加属性设置: android:descendantFocusability="blocksDescendants" 如果只能点击checkbox,而无法触发item的点击事件,那么可以禁掉checkbox的焦点获取,不让它可以点击就可以了 checkbox里面加 android:focusable="false" android: