javascript - Cant switch to fullscreen mode from an iframe -


i have backbone view button should make view goto fullscreen on click. i'm using screenfull.js, , cant see different examples , code. console.log(screenfull.enabled); return false in 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 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();   }  } 

the problem app runs in iframe. adding allowfullscreen="true" attribute iframe fixes bug.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -