Ticket #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: | ||
| Blocking: | Blocked by: |
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
comment:1 in reply to: ↑ description Changed 3 years ago by rlrosario
comment:3 Changed 2 years ago by dmethvin
- Owner set to dmethvin
- Priority changed from undecided to low
- Status changed from open to assigned
- Milestone changed from 1.4.2 to 1.6
comment:4 Changed 2 years ago by john
- Priority changed from low to high
- Milestone changed from 1.6 to 1.next
comment:5 Changed 23 months 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:7 Changed 21 months 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:9 Changed 20 months ago by Dave Methvin
- Status changed from assigned to closed
- Resolution set to fixed
Fix #6170. Don't try to run DOM methods on window.
Changeset: 6872d31f5a7d6162161b61bfd35ad0e8aa545395
comment:10 Changed 20 months ago by dmethvin
#10355 is a duplicate of this ticket.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

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?