Bug Tracker

Opened 13 years ago

Closed 13 years ago

#1334 closed bug (duplicate)

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.

Change History (2)

comment:2 Changed 13 years ago by brandon

Resolution: duplicate
Status: newclosed

Duplicate of #1402

Note: See TracTickets for help on using tickets.