Opened 11 years ago
Closed 11 years ago
#12169 closed bug (invalid)
live event in full screen
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8rc1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
live event like:
$(document).on("click",selector,funtion(){alert("coucou");});
no longer fire when toggled in full screen with elem.requestFullScreen()
but classic event like:
$(selector).click(funtion(){alert("coucou");});
works as expected
I can not provide a jsfiddle because it does not support full screen api.
Change History (3)
comment:1 Changed 11 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:2 Changed 11 years ago by
Sorry for my english (I am French ;)), the no longer isn't justified, this is not a regression in 1.8rc1, 1.7.2 doesn't work too.
here is my test code:
<html> <head> <script src="http://code.jquery.com/jquery-1.8rc1.js"></script> <script> $(document).ready(function(){ $("#gofull").click(function(){ var elem=$("#content")[0]; if(elem.requestFullScreen){ // w3c elem.requestFullScreen(); }else if(elem.webkitRequestFullScreen){ elem.webkitRequestFullScreen(); }else if(elem.mozRequestFullScreen){ elem.mozRequestFullScreen(); }else{ alert("Full screen api unsupported by your browser"); } }); $("#test1").click(function(){ alert("classic test ok"); }); $(document).on("click","#test2",function(){ alert("live test ok"); }); }); </script> </head> <body> <button id="gofull">go full screen</button> <div id="content"> <button id="test1">classic test</button> <button id="test2">live test</button> </div> </body> </html>
only the classic event survive to toggle the div id=content to full screen. I test under chrome and firefox, the live event doesn't fire in full screen mode. it doesn't seem to correspond to your suggered bug. pity that jsfiddle doesn't handle full screen api...
comment:3 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Please ask for help in the forum, since it doesn't look like this is a bug. This would be the expected behavior, for example, if the event is fired directly on document
.
Are you saying this is a regression in jQuery? It is hard to tell since there is no test case. We need a complete test case.
If it "no longer" works, perhaps Firefox changed?
https://bugzilla.mozilla.org/show_bug.cgi?id=703079
Since delegated events are caught for the elements *BELOW* the one where the handler is attached, attaching at
document
would be incorrect if the event is fired ondocument
itself.