ie浏览器加载jquery,通过append()方法,使光标轻过当前元素时显示最上端,可是按123456按钮却没反应,连续按两下才有反应。像firefox、chrome等浏览器都能正常显示,惟有IE8、9、10、11统统都是一样的,点一下没反应,点两下才有反应了。
代码如下:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.js"></script>
</head>
<body style="position: relative;">
<div id="main">
<div class="editor" style="position: absolute;height:500px;width:600px;background-color:lime;">aaaaaaaaa</div>
<div class="editor" style="position: absolute;height:500px;width:600px;left:300px;background-color: aqua;">bbbbbbbb
<button onclick="alert('ok')">123456</button>
</div>
</div>
</body>
</html>
<script>
$("#main").delegate(".editor","mouseover",function(e){
$("#main").append($(this))
})
</script>
ie浏览器加载jquery,通过append()方法,事件没反应。
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- Go 旅城通票 2017-01-09 13:27关注
设置z-index就行了,dom操作导致ie重复触发mouseover
$("#main").delegate(".editor", "mouseover", function (e) { $("#main").append($(this)) console.log(new Date().getTime())//加这个你 就知道了,不停的在操作 })
===》
<script> var zIndex = 1; $("#main .editor").mouseenter(function (e) { $(this).css('z-index',zIndex++) console.log(new Date().getTime()) }) </script>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
- ¥20 有关区间dp的问题求解
- ¥15 多电路系统共用电源的串扰问题
- ¥15 slam rangenet++配置
- ¥15 有没有研究水声通信方面的帮我改俩matlab代码
- ¥15 ubuntu子系统密码忘记
- ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
- ¥15 保护模式-系统加载-段寄存器
- ¥15 电脑桌面设定一个区域禁止鼠标操作
- ¥15 求NPF226060磁芯的详细资料