我的页面是建立这样的:jQuery的鼠标按下/鼠标松开防止点击
<table>
<thead>
<tr>
<th>
Test
<div class="drag"/>
</th>
<th>
......
......
</th>
</tr>
</thead>
</table>
.drag {
position: absolute;
right: 0;
bottom: 0;
top: 0;
background-color: yellow;
width: 3px;
}
的目的是拖我colums上的<div class="drag"/>
鼠标按下/鼠标松开事件的宽度和它的作品不错。但是我的<th>
元素上也有一个点击事件。 问题是,当我释放鼠标仍在<th>
上时,点击事件仍然是<th>
触发器。几乎是在MouseDown事件
- stopPropagation():
我已经试过几件事情鼠标事件
有没有其他方法可以防止点击事件?
编辑: 我仍想保留的点击事件上<th>
,但我不希望它开始后,我已经拖
请从你的代码中添加[MCVE(http://stackoverflow.com/help/mcve),所以我们可以看到它的工作(即使它与假动作)。现在,你不显示任何脚本(和问题只有脚本标记)和CSS不匹配发布HTML –