A
Abraham Durceau
Hi, everybody!
I want to implement in JScript an image-dragging functionality like the one
in image processing apps like Adobe Photoshop etc., when:
a) I press a left button when a cursor is over the image (say, x0,y0).
b) Holding a button, I start dragging. An image 'sticks' to a cursor and
moves with it.
c) When I release a button, an image has to reside in (x1,y1) until I want
to drag it again.
At this time I KNOW how:
a) To intercept a mouse-click (measuring X and Y and storing in a function
called by onkeyup event)
b) How to draw an image
[Seriously, (b) may matter, since image may be drawn either as itself,
or as a background of some element, which may be dragged.]
What I don't know, is:
a) what HTML elements may be dragged, and what may not; and what methods
should be used.
- So, would anybody be so kind to provide a relevant link, or a code sample,
or... maybe it's impossible to do it at all - sorry, I'm a novice in JScript
programming...
Thanks in advance.
I want to implement in JScript an image-dragging functionality like the one
in image processing apps like Adobe Photoshop etc., when:
a) I press a left button when a cursor is over the image (say, x0,y0).
b) Holding a button, I start dragging. An image 'sticks' to a cursor and
moves with it.
c) When I release a button, an image has to reside in (x1,y1) until I want
to drag it again.
At this time I KNOW how:
a) To intercept a mouse-click (measuring X and Y and storing in a function
called by onkeyup event)
b) How to draw an image
[Seriously, (b) may matter, since image may be drawn either as itself,
or as a background of some element, which may be dragged.]
What I don't know, is:
a) what HTML elements may be dragged, and what may not; and what methods
should be used.
- So, would anybody be so kind to provide a relevant link, or a code sample,
or... maybe it's impossible to do it at all - sorry, I'm a novice in JScript
programming...
Thanks in advance.