About click and mousedown

I have some trouble that in useing “onclick” and “onmousedown” event.
I bind two event on the same div. bucause I want to drag this div. So I should do some thing when trigger onmousedown event. At the same time I want show a other div when I click it.
now it show a other div when I draging it … it really bugs me…
some people can help me. thx.

First the onmousedown event triggers, then when you finish dragging the onmouseup event triggers, lastly followed by the onclick event.

You need the onmouseup event to record whether the drag process occurred or not. Then you can have the onclick event check if the drag process occurred, and if it didn’t the onclick event can then show the menu.

thank you!