Closed Thread Icon

Preserved Topic: quick drag and drop question (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18391" title="Pages that link to Preserved Topic: quick drag and drop question (Page 1 of 1)" rel="nofollow" >Preserved Topic: quick drag and drop question <span class="small">(Page 1 of 1)</span>\

 
maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 03-16-2002 04:30

ok so I have a simple little drag and drop script located here: http://www.kewlster.com/testing.html and I just noticed that it doesn't work with images. Any ideas???

PS This should be obvious but both the image and the text are supposed to be dragable
PS (again) It really sucks to be on the other side of the world from you guys, too much time difference, now it'll take a few more hours before any of you are awake, much less answering questions


http://www.kewlster.com

[This message has been edited by maninacan (edited 03-16-2002).]

[This message has been edited by maninacan (edited 03-16-2002).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-16-2002 05:39

Ah, in order to tell the browser that you've taken care of the mousedown event, so that the browser doesn't try to do something with it itself (such as let you drag the image's url to the address bar), you have to return false from the event. So add

return false;

to the end of the event. Also, for good browsers like mozilla, you have to say

e.cancelBubble()

where e is the object passed to the event function as its first argument.

I may have some of this wrong; if you want an immediate answer, check my code at www.slimeland.com/cyanslime/insanesrc.js (see it in action from the link from my main page.) Look for the events in there, they may be hard to pick out but you can do it if you need to =)

maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 03-16-2002 06:40

ok so I see in your insanesrc.js some places where that's called but I really can't make heads or tales of it. I tried return false; and it worked, sorta. Now it doesn't let you do the built in thing where you drag and drop the image somewhere (i.e. another program or something), but it doesn't do my thing either, now it just puts the circle with a slash through it mouse icon up. Any help... Please...

http://www.kewlster.com

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-16-2002 08:23

Hmm, try returning true instead. Try a mix of falses and trues. All the different events behave differently, I forget what wants which.

maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 03-16-2002 19:00

I've tried that about a million times and it still doesn't work. Does anybody know this one? Is it just not possible to drag an image?

http://www.kewlster.com

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 03-18-2002 08:15

it is possible to drag images,

links:
http://www.brothercake.com/scripts/dock.shtml

and
http://www.dithered.com/experiments/1kdhtml/extensions/index.html

DmS
Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 03-19-2002 00:00

I've done this a couple of times in IE, here is an example: http://www.dmsproject.com/test/dragger.html
It's a quick one and it doesn't work in anything but IE, so it needs work
I think the problem is somewhere in the catching of the event to make this one work in more browsers, but I have no time at the moment. Maybe it can get you started.
/Dan


-{ a vibration is a movement that doesn't know which way to go }-

« BackwardsOnwards »

Show Forum Drop Down Menu