Side navigation
#12472 closed bug (invalid)
Opened September 05, 2012 08:55PM UTC
Closed September 05, 2012 09:08PM UTC
Window on event mouseup body selector no longer working
Reported by: | the.only.storm@gmail.com | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
1. Latest 1.8.1 (this code was working on 1.8.0, I verified it)
2. Latest Chrome 21 (although my colleague informed me it is not reproducible in IE 9, but I cannot verify his claim)
3. OSX 10.8
4. Use the following code:
$('body').addClass('has-active-menu');
$(window).on('mouseup', 'body.has-active-menu', function () {
alert('test');
});
Then click anywhere on the screen, nothing happens. You can try mousedown too, doesn't work either.
5. This code worked in 1.8.0 and 1.7, it is valid code (delegation of the window/html tag to the body tag). My expectation is that alert will fire.
Attachments (0)
Change History (1)
Changed September 05, 2012 09:08PM UTC by comment:1
resolution: | → invalid |
---|---|
status: | new → closed |
You should be using
document
. That is the highest point that supports delegated events. The fact that it used to work withwindow
doesn't mean it was meant to work.