From:  jeffry killen <>
Date:  24 May 2009 07:53:10 Hong Kong Time

DOM level 2 events


I am doing some development with DOM level 2
OOP javascript code with event handling.
I have written code that defines and uses objects
and constructor methods to format with css attributes
and display (via clicking a visible button in the document)
and hide (using a button that appears in the div that is
To this div I have attached mousemove, mousedown
and mouseup events so I can apply drag to the divs.
It  all works but is noticeably slow in responding to
mousedown, mousemove, and mouseup events.

Part of this problem is that if I attach the mouse events to
the div as a whole, I cannot click the close button because
the mousemove even takes precedence. So, there is a title
panel displayed  in a nested div to which the mouse events
are attached. That means that the outer div (that responds
to relocation code) adds another level of event handling.

When the divs are hidden, and the event listeners are
removed the page is still noticeably sluggish in response
to text entry in a text field and other event type activities.

My aim is to develop custom drag-able dialog boxes.
I have seen this type of behavior in some large web sites, for one (forms to send applications to job
opportunity posters). I have not gone to the trouble of
mining their code. I write my own with books from O'Reilly
and others, from scratch.

I would not expect anyone here to debug this for me, but
if there are any suggestions that might occur to someone,
I would appreciate it.

I am running this on an older Mac PPC machine and will
try it on a much newer Mac G5 to see what the difference
is, if any,
And I will try it on the dev server which is a late model laptop
running Ubuntu Linux.
The Linux server is considerably better but still shows a delay.
The Mac G5 is also considerably better and still shows a delay.

The OOP code appears to retain values much like in a cache of
its own because reloading from the server or clearing the
browser cache seems to have no effect on some aspects. (some
code changes do not show results when page is reloaded from
server, or browser cache is cleared)

I am using Firefox for dev and test on Safari and Opera.

Thank you in advance;