I want to create a multi select box (click and drag at empty space then will have a blue div ), but the click and drag is inconsistent and i cant find out the problem.
try to drag from a empty space that is around the bottom right , top right or bottom left and you can see that the light blue box didnt actually start from the point where the mouse down
In your code I changed
to
The new code can be seen @ http://jsfiddle.net/jk4Uc/6/
EDIT
Try this http://jsfiddle.net/jk4Uc/10/ in this your dragging starts exactly from mouse down. I changed
e.pageXtoe.clientX.EDIT
This is working precisely as you asked @ http://jsfiddle.net/jk4Uc/11/
Changed
Hope this is what you are looking for.