[Javascript] Wolter Zorn's Drag and Drop Script

Terry Riegel riegel at clearimageonline.com
Thu Aug 24 13:45:25 CDT 2006


Hello again,

I am working with Walter Zorn's drag and drop script. It works great  
from the page on his site, but I can't get it working on my site with  
IE 6. It works great in FF (mac and Win), and Safari. Any help would  
be greatly appreciated.

The URL is:
http://clearimageonline.com/projects/draganddrop/draganddrop.html



Also if anyone is interested I have a functional prototype of my  
first AJAX application. It is (yet another) photo album. It works  
very similar to the way iPhoto works on the Mac. I would love to get  
some feedback and direction on this project. So far I have

1. Select/Deselect elements via the class attribute
2. Deselect all
3. Drag selection to non-dropzone works with snapback
4. Drag selection to dropzone works with dropin
5. Select None
6. All of the events above are communicated to the server.


http://clearimageonline.com/pages/start/projects/draganddrop/album.html


Thanks,

Terry Riegel

On Aug 23, 2006, at 9:28 AM, Terry Riegel wrote:

> Hello,
>
> Roger, thanks you are right it was an event once I got that I was  
> able to see that my addition was in the wrong place.
>
> I am having trouble getting Walter Zorn's script working on IE6.0.  
> I am able to go to his site http://www.walterzorn.com and his drag  
> and drop library works just fine in IE6, but when I create a simple  
> duplicate on my site it works for Safari, but not IE6. Would anyone  
> care to take a look. I have tried to keep my example to the bare  
> bones.
>
> http://clearimageonline.com/projects/draganddrop/draganddrop.html
>
> This example will load a picture that you should be able to drag  
> around the page. It also has an alert link that displays the  
> coordinates and size of the image. The library is starting to load  
> as the alert link is correct, It just wont drag around.
>
> Terry
>
> On Aug 22, 2006, at 9:42 PM, Roger Roelofs wrote:
>
>> Terry,
>>
>> On Aug 22, 2006, at 3:32 PM, Terry Riegel wrote:
>>
>>> I am working with a drag and drop library written by Walter Zorn.  
>>> He does some pretty cool things with his script. As I look at his  
>>> code I first realize that I don't really understand OOP.
>> Javascript OOP is a bit different than other languages, so it  
>> takes a while to understand it.
>>
>>> I am trying to add a property to an object. Can anyone tell me  
>>> why my addition isn't working?
>>>
>>> dd.evt = function(d_e)
>>> {
>>> 	this.but = (this.e = d_e || window.event).which || this.e.button  
>>> || 0;
>>> 	this.button = (this.e.type == 'mousedown')? this.but
>>> 		: (dd.e && dd.e.button)? dd.e.button
>>> 		: 0;
>>> 	this.src = this.e.target || this.e.srcElement || null;
>>> 	this.src.tag = ("" + (this.src.tagName || this.src)).toLowerCase();
>>> 	this.x = dd.Int(this.e.pageX || this.e.clientX || 0);
>>> 	this.y = dd.Int(this.e.pageY || this.e.clientY || 0);
>>>
>>> // My humble addition
>>> this.terryriegel = 723;
>>> // End my humble addition
>>>
>>>
>>> 	if(dd.ie)
>>> 	{
>>> 		this.x += dd.getScrollX() - (dd.ie && !dd.iemac)*1;
>>> 		this.y += dd.getScrollY() - (dd.ie && !dd.iemac)*1;
>>> 	}
>>> 	this.modifKey = this.e.modifiers?  
>>> this.e.modifiers&Event.SHIFT_MASK : (this.e.shiftKey || false);
>>> };
>>
>> Two questions.  What makes you think it isn't working?  Do you use  
>> this.terryriegel somewhere else in the code?  Also, 'this' in  
>> javascript isn't always what you expect.  The code you pasted  
>> looks like an event handler.  In this context, 'this' may well be  
>> the window object rather than dd.
>>
>> This is one of those cases where a url would be especially helpful  
>> in debugging.
>>
>> hth
>> -- 
>> Roger Roelofs
>> Datacomp Appraisal Services
>>
>> _______________________________________________
>> Javascript mailing list
>> Javascript at LaTech.edu
>> https://lists.LaTech.edu/mailman/listinfo/javascript
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list