My page is built like that:
<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;
}
The intention is to drag the width of the my colums with mousedown/mouseup-events on the <div class="drag"/>
and it works nice. But there's also a click event on my <th>
-elements.
The problem is, when I release the mouse still on the <th>
, the click event still of <th>
triggers.
I've tried several things:
- stopPropagation() on almost every event that's there
- return false in the mousedown event
- unbind the click event in mousedown and bind it again in the mouseup event
Is there any other way to prevent the click-event?
Edit:
I still want to keep the click-event on that <th>
but I dont want it to start after i've dragged