admin管理员组文章数量:1287720
I have a Backbone view with a button that should make the view goto fullscreen on click. I'm using screenfull.js, and I cant see any different from the examples and my code. But console.log(screenfull.enabled);
always return false
in the clickHandler.
var FullScreenButton = Backbone.Marionette.ItemView.extend({
tagName: 'button',
initialize: function () {
this.$el.click(_.bind(this.goFullScreen, this));
},
goFullScreen: function () {
console.log(screenfull.enabled);
screenfull.request(this.options.container);
}
});
also without screenfull.js it dont g oto fullscreen:
goFullScreen: function() {
var element = document.documentElement;
if (element.requestFullScreen) {
element.requestFullScreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}
I have a Backbone view with a button that should make the view goto fullscreen on click. I'm using screenfull.js, and I cant see any different from the examples and my code. But console.log(screenfull.enabled);
always return false
in the clickHandler.
var FullScreenButton = Backbone.Marionette.ItemView.extend({
tagName: 'button',
initialize: function () {
this.$el.click(_.bind(this.goFullScreen, this));
},
goFullScreen: function () {
console.log(screenfull.enabled);
screenfull.request(this.options.container);
}
});
also without screenfull.js it dont g oto fullscreen:
goFullScreen: function() {
var element = document.documentElement;
if (element.requestFullScreen) {
element.requestFullScreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}
Share
Improve this question
edited Aug 28, 2013 at 18:15
Andreas Köberle
asked Aug 28, 2013 at 14:51
Andreas KöberleAndreas Köberle
111k58 gold badges280 silver badges307 bronze badges
1 Answer
Reset to default 12The problem is that the app runs in an iframe. Adding the allowFullScreen="true"
attribute to the iframe fixes the bug.
本文标签: javascriptCant switch to fullscreen mode from an iframeStack Overflow
版权声明:本文标题:javascript - Cant switch to fullscreen mode from an iframe - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741321700a2372240.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论