Below this point is the same document above, but in an iframe, for testing the ‘cancel’ event: 
Drag the ball around and view the output in the two boxes below. Inspect the ‘DragJavaScript’ function to determine how to detect drag events. 
The box on the left shows Start, End and Cancel, and the right box shows all ‘move’ events. Cancel only occurs when dragging an element when it is in  an iframe and the drag event starts in the iframe and moves outside of it.