[Javascript] Wolter Zorn's Drag and Drop Script
Terry Riegel
riegel at clearimageonline.com
Tue Aug 22 14:32:13 CDT 2006
Hello,
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. I am trying to add
a property to an object. Can anyone tell me why my addition isn't
working?
---START---
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);
};
---END---
Thanks,
Terry Riegel
More information about the Javascript
mailing list