Skip to main content

Bug Tracker

Side navigation

#1334 closed bug (duplicate)

Opened June 29, 2007 10:30AM UTC

Closed July 20, 2007 09:14PM UTC

IE7: fix() is not working sometimes

Reported by: XASD Owned by:
Priority: major Milestone:
Component: core Version: 1.1.2
Keywords: Cc:
Blocked by: Blocking:
Description

Somtimes,following code dosen't work in IE7:

	fix: function(event) {
		// Fix target property, if necessary
		if ( !event.target && event.srcElement )
			event.target = event.srcElement;

		// Calculate pageX/Y if missing and clientX/Y available
		if ( event.pageX == undefined && event.clientX != undefined ) {
			var e = document.documentElement, b = document.body;
			event.pageX = event.clientX + (e.scrollLeft || b.scrollLeft);
			event.pageY = event.clientY + (e.scrollTop || b.scrollTop);
		}

"b" is null on page initialization time(though document.body is not null),so expression:

(e.scrollLeft || b.scrollLeft) dosen't evaluate and throws "Object required" exception in "b.scrollLeft",because "e.scrollLeft" is "0" in that time.

This bug is repeatable,if reload the same page several times,it popups sometimes.

Attachments (0)
Change History (2)

Changed June 29, 2007 10:41AM UTC by XASD comment:1

Changed July 20, 2007 09:14PM UTC by brandon comment:2

resolution: → duplicate
status: newclosed

Duplicate of #1402