Grant points us to a cross-browser drag-and-drop example. Good stuff, and Grant was the king of Javascript at a previous employer, so I’ll listen to his recommendation. etLux’s implementation, though, seems to rely on pasting code into too many different places.
I like the simplicity of Dean Edward’s moz-behaviors (bold emphasis mine).
moz-behaviors.xml is an XBL binding that allows Mozilla browsers (Netscape, Mozilla, Firefox etc) to use Microsoft DHTML Behaviorswith little or no conversion. Mozilla and Explorer may then reference the same DHTML Behaviors (.htc files).
moz-behaviors.xmlis the only file you need to enable DHTML Behaviors for Mozilla browsers.
the XBL binding includes code that implements the addBehavior method for Mozilla’s HTML Elements. The code has been compressed using the javascript packer available from this site.
you do not need to write any additional code to implement DHTML Behaviors for Mozilla.
further, when writing behaviors, you do not need to do any browser sniffing. Mozilla’s object interfaces have been extended to enable browser compatibility.