Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#6170 closed bug (fixed)

jQuery(window).scroll(); causes IE* to scroll to 0,0

Reported by: rlrosario Owned by: dmethvin
Priority: high Milestone: 1.7
Component: event Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:

Description

Triggering the scroll event on the window ('jQuery(window).scroll();') should be considered a special case because the window object has a scroll method that takes two parameters: x,y. On non-IE browsers, the call gets ignored when parameters aren't passed in. But on IE*, the call takes on 0,0 as a default and scrolls the page. This issue is preventing me from triggering scroll handlers this way because of the undesirable side effect.

I wrote a patch on github: http://github.com/rlr/jquery/commit/10966bb9b0c46c69697ebf4703b8ddc9906648f3

Change History (10)

comment:1 in reply to:  description Changed 13 years ago by rlrosario

Any way to edit this bug? It really should be Version 1.4.2 Milestone 1.4.3 but that wasnt available when I submitted it?

comment:2 Changed 13 years ago by dmethvin

Priority: undecided
Status: newopen

comment:3 Changed 12 years ago by dmethvin

Milestone: 1.4.21.6
Owner: set to dmethvin
Priority: undecidedlow
Status: openassigned

comment:4 Changed 12 years ago by john

Milestone: 1.61.next
Priority: lowhigh

comment:5 Changed 12 years ago by dmethvin

This is the problem where we execute methods on things that are not .nodeType===1 DOM elements, such as window or plain Object. The solution is to not run those methods for such cases.

comment:6 Changed 12 years ago by john

(This was confirmed during the bug triage meeting.)

comment:7 Changed 12 years ago by dmethvin

Since this behavior may be desired (or at least currently used) for plain objects, I'm only planning to exclude window in the 1.7 patch.

comment:8 Changed 12 years ago by dmethvin

Milestone: 1.next1.7

comment:9 Changed 12 years ago by Dave Methvin

Resolution: fixed
Status: assignedclosed

Fix #6170. Don't try to run DOM methods on window.

Changeset: 6872d31f5a7d6162161b61bfd35ad0e8aa545395

comment:10 Changed 12 years ago by dmethvin

#10355 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.