July 23, 2000 - The ondragstart() Method
July 23, 2000 The ondragstart() Method Tips: July 2000
Yehuda Shiran, Ph.D.
|
In JavaScript, you use the ondragstart event. You may want to include it in the HTML statement:
<TAG ondragstart = "handler...">
or in a JavaScript statement:
object.dragstart = handler;
The draggable objects are text selections and selected objects. Any text on the page is draggable once it selected is. It may be a fixed text that is part of the page, an entry field, or text area. The following text and image are programmed to give you an alert box. Select any text on this page and then drag it. The alert box will pop up. Now try dragging the photo on the left top corner of the page. The alert box will pop up again. All you need to do is to add to the BODY
tag the ondragstart
event handler:
<BODY ondragstart="alert('object dragged')>