dataTransfer.setData() and .getData() commands in FireFox?

D

dwhalen

Hi Everyone.

I'm new to drag-and-drop, and I'm running into a problem getting some
code I found to work in FireFox. I have a third-party Tree control
that accepts droppable items that implement the setData and getData
methods. In IE6/7
the following code is draggable:

<img src="Images/TreeIcons/file.gif" border="0"
onDragStart="event.dataTransfer.setData('text', '2|16|190');" />

I'm able to drag it right onto the tree and get the needed value "2|16|
190"

When I load the same code in Firefox I can't get the image to drag at
all, and therefore I don't know if it'll even
drop. If I can get it to drop, I need to be sure I can use
dataTransfer.getData()

Can anyone point me in the right direction to get this working?

Thanks so much!
 
M

Martin Honnen

dwhalen said:
<img src="Images/TreeIcons/file.gif" border="0"
onDragStart="event.dataTransfer.setData('text', '2|16|190');" />
When I load the same code in Firefox I can't get the image to drag at
all, and therefore I don't know if it'll even
drop. If I can get it to drop, I need to be sure I can use
dataTransfer.getData()


ondragstart and event.dataTransfer are currently supported by IE only I
think. Mozilla does not support that.
 
D

dwhalen

Is there a way to hot-wire such code? For example, if I can get the
drag to actually
go, then I can maybe take it from there.

I see a lot of examples of people that can get stuff to drag in
Firefox, but I can't make
any of them work for some reason. I know that Firefox doesn't support
it, but surely
a workaround is possible....

Thanks!
 
R

RobG

Is there a way to hot-wire such code? For example, if I can get the
drag to actually
go, then I can maybe take it from there.

Please don't top-post here, reply below trimmed quotes.

I see a lot of examples of people that can get stuff to drag in
Firefox, but I can't make
any of them work for some reason. I know that Firefox doesn't support
it, but surely
a workaround is possible....

There are many "draggable" libraries out there, here's a few that work
well in modern browsers:

YAHOO! UI
<URL: http://developer.yahoo.com/yui/dragdrop/ >

FORK
<URL: http://forkjavascript.org/drag/tests >

WalterZorn
<URL: http://www.walterzorn.com/dragdrop/dragdrop_e.htm >
 
X

Xavier

There are many "draggable" libraries out there, here's a few that work
well in modern browsers:

YAHOO! UI
<URL: http://developer.yahoo.com/yui/dragdrop/ >

FORK
<URL: http://forkjavascript.org/drag/tests >

WalterZorn
<URL: http://www.walterzorn.com/dragdrop/dragdrop_e.htm >

But these libraries do not implement "drag and drop" but merely "select and
move",
which is a very different thing that won't allow you to go beyond the
boundaries of the document that holds the elements to be dragged...

Xavier
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top