Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / September 2005



Tip: Looking for answers? Try searching our database.

onDrop event not working correctly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rich@newsguy.com - 29 Sep 2005 00:23 GMT
Hi,

Been trying to work through a simple drag and drop interface using either IMG,
SPAN or DIV tags. That way I can define blocks of text and/or graphics as
draggable and be able to drop them on a similar (img, div, span, etc.) target,
preferably an image.

I can highlight text from an "<input type=text>" field and reach a target to
trigger an event (e.g. alert();), but can't get the same response when the
dragged item is a block of text or an graphic and drop it on either of the same
targets.

Example Page: http://web.newsguy.com/fp2000/testdnd.html

The Microsoft site mentioned that the onDrop event has some default
characteristics that limit the dragged object to an input field, but other tags
can be used if the "ondragover="window.event.returnValue=false" and
ondragenter="window.event.returnValue=false" settings are added to get around
the defaults. Not sure if I'm overlooking the obvious or if I misunderstood
this. Any tips or alternate recommendations appreciated.

Thanks in advance,

Rich
--
Newsguy -- http://newsguy.com
commercial - 29 Sep 2005 09:11 GMT
Don't rely on MS only characteristics.

They are here today. They are gone tommorrow.

---------------------------------------

> Hi,
>
[quoted text clipped - 22 lines]
> --
> Newsguy -- http://newsguy.com
rich@newsguy.com - 29 Sep 2005 17:00 GMT
>Don't rely on MS only characteristics.
>
>They are here today. They are gone tommorrow.

Actually tested the code across a number of browsers. I can setup drag and drop
so a selected item moves around a web page on different web browsers (e.g. FF,
Safari, IE). If the non-MS browsers are able to drag an item around a web page
just as IE does, it would seem useless to have that available unless javascript
had the "onDrop" functionality to trigger something when the drag is done.

Maybe I'm taking the wrong approach to this. Anyone heard of a way to simulate
drag and drop, maybe with a combination of onMouse... events, that can be used
as an alternative. Certainly wouldn't want to limit its usefulness to IE.

Thanks,
Rich
--
Newsguy -- http://newsguy.com

>---------------------------------------
>
[quoted text clipped - 31 lines]
>> --
>> Newsguy -- http://newsguy.com
RobG - 30 Sep 2005 02:00 GMT
>>Don't rely on MS only characteristics.
>>
[quoted text clipped - 5 lines]
> just as IE does, it would seem useless to have that available unless javascript
> had the "onDrop" functionality to trigger something when the drag is done.

I think you mean that the DOM should have a 'drop' event.  But anyway,
it doesn't.  I guess ondrop has been implemented by some browser vendors
in order to provide that functionality, but non-standards stuff is
generally more inconsistent than standards-based stuff (innerHTML
springs to mind).

DOM 2 events:
<URL:http://www.w3.org/TR/DOM-Level-2-Events/events.html>

DOM 3 events:
<URL:http://www.w3.org/TR/DOM-Level-3-Events/events.html>

> Maybe I'm taking the wrong approach to this. Anyone heard of a way to simulate
> drag and drop, maybe with a combination of onMouse... events, that can be used
> as an alternative. Certainly wouldn't want to limit its usefulness to IE.

Yes, using a combination of other events.  There is some stuff at the
link below that may be useful:

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

[...]

Signature

Rob

Randy Webb - 29 Sep 2005 18:56 GMT
commercial said the following on 9/29/2005 4:11 AM:

> Don't rely on MS only characteristics.

Half true.

> They are here today. They are gone tommorrow.

Totally false.

Signature

Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.