admin管理员组文章数量:1023263
My Code:
$('#divid').on('mozfullscreenchange webkitfullscreenchange fullscreenchange MSFullscreenChange', notify);
$('#divid').bind('mozfullscreenchange webkitfullscreenchange fullscreenchange MSFullscreenChange', notify);
webkitfullscreenchange
works as expected, but mozfullscreenchange
seems to do nothing.
.bind
doesn't help either.
What am I doing wrong?
My Code:
$('#divid').on('mozfullscreenchange webkitfullscreenchange fullscreenchange MSFullscreenChange', notify);
$('#divid').bind('mozfullscreenchange webkitfullscreenchange fullscreenchange MSFullscreenChange', notify);
webkitfullscreenchange
works as expected, but mozfullscreenchange
seems to do nothing.
.bind
doesn't help either.
What am I doing wrong?
Share Improve this question edited May 13, 2015 at 17:21 OneHoopyFrood 3,9793 gold badges27 silver badges39 bronze badges asked May 13, 2015 at 16:40 Allan Felipe MuraraAllan Felipe Murara 5263 silver badges14 bronze badges 2- 1 Could you provide some background on what your end goal is? – OneHoopyFrood Commented May 13, 2015 at 17:02
- i need to know when user left fullscreen to validate input infos. – Allan Felipe Murara Commented May 13, 2015 at 17:17
3 Answers
Reset to default 5According to the last ment here:
the event is fired at the document, not at the element that goes full-screen
They also say it is documented on mozilla developer pages.
So put the listener on a document
, not on the element.
Thanks to simon, i forgot the moz documentation.
final mand :
document.addEventListener("fullscreenchange", notify);
document.addEventListener("webkitfullscreenchange", notify);
document.addEventListener("mozfullscreenchange", notify);
document.addEventListener("MSFullscreenChange", notify);
Mobile Safari and Chrome needed this to detect the exit of fullscreen:
video.addEventListener('webkitendfullscreen', function () {
// do stuff here
}, false);
My Code:
$('#divid').on('mozfullscreenchange webkitfullscreenchange fullscreenchange MSFullscreenChange', notify);
$('#divid').bind('mozfullscreenchange webkitfullscreenchange fullscreenchange MSFullscreenChange', notify);
webkitfullscreenchange
works as expected, but mozfullscreenchange
seems to do nothing.
.bind
doesn't help either.
What am I doing wrong?
My Code:
$('#divid').on('mozfullscreenchange webkitfullscreenchange fullscreenchange MSFullscreenChange', notify);
$('#divid').bind('mozfullscreenchange webkitfullscreenchange fullscreenchange MSFullscreenChange', notify);
webkitfullscreenchange
works as expected, but mozfullscreenchange
seems to do nothing.
.bind
doesn't help either.
What am I doing wrong?
Share Improve this question edited May 13, 2015 at 17:21 OneHoopyFrood 3,9793 gold badges27 silver badges39 bronze badges asked May 13, 2015 at 16:40 Allan Felipe MuraraAllan Felipe Murara 5263 silver badges14 bronze badges 2- 1 Could you provide some background on what your end goal is? – OneHoopyFrood Commented May 13, 2015 at 17:02
- i need to know when user left fullscreen to validate input infos. – Allan Felipe Murara Commented May 13, 2015 at 17:17
3 Answers
Reset to default 5According to the last ment here:
the event is fired at the document, not at the element that goes full-screen
They also say it is documented on mozilla developer pages.
So put the listener on a document
, not on the element.
Thanks to simon, i forgot the moz documentation.
final mand :
document.addEventListener("fullscreenchange", notify);
document.addEventListener("webkitfullscreenchange", notify);
document.addEventListener("mozfullscreenchange", notify);
document.addEventListener("MSFullscreenChange", notify);
Mobile Safari and Chrome needed this to detect the exit of fullscreen:
video.addEventListener('webkitendfullscreen', function () {
// do stuff here
}, false);
本文标签: javascriptMozfullscreenchange event doesn39t fireStack Overflow
版权声明:本文标题:javascript - Mozfullscreenchange event doesn't fire - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745550378a2155604.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论