The code for the event handler, which makes IE compatible with the DOM handler, needs to be updated to work properly.
Specifically, the document.body.scrollLeft and document.body.scrollTop values always return zero (0), because they include the 'px' at the end.
Therefore, the code needs to have parseInt() added as follows:
Code:
oEvent.pageX = oEvent.clientX + parseInt(document.body.scrollLeft);
oEvent.pageY = oEvent.clientY + parseInt(document.body.scrollTop);
I think this error only happens when using an XHTML doctype, but I'm not sure. The parseInt() makes it work for all setups, regardless of doctype.
There may be other places in the book that need to be updated in the same manner, but this is really the only place I've come across it so far.
Specifically, any place that reads a length property from the style object of an element needs parseInt() added.
For example:
Code:
var x = parseInt(getElementById('sample').style.left);
Hope this helps!