hi,
i want to drag the div which have a image in it:
but i find that if i click on the image, i cannot drag the div, (in FF3.5)
any advice would be appreciated.
and i have a JS something like that...:
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
I'd assume that the image is "on top" of the div (a child), so you're acting on the image, not the div.
I'd search the web for "draggable div" (or something similar) since this problem has obviously been solved thousands of times.
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15003
posted
0
Guessing you are getting that save option when you try dragging the inage. You can try canceling the default action:
Eric
Lek Kin Wong
Ranch Hand
Joined: Feb 23, 2010
Posts: 30
posted
0
Eric Pascarello wrote:Guessing you are getting that save option when you try dragging the inage. You can try canceling the default action:
Eric
thank you for your kindly suggestion,
actually i tried this before i make this post, but not working in my situation,
e.target still refer to the img.id, but not the div.id...
Lek Kin Wong
Ranch Hand
Joined: Feb 23, 2010
Posts: 30
posted
0
David Newton wrote:I'd assume that the image is "on top" of the div (a child), so you're acting on the image, not the div.
I'd search the web for "draggable div" (or something similar) since this problem has obviously been solved thousands of times.
thanks,
im trying img.parentNode... :)
subject: How to drag a DIV if there is a image inside?