Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set IFrame allowfullscreen with javascript

I tried to set allowfullscreen attribute to the iframe, but it doesn't work:

iframe.allowFullScreen = true

I checked it with chrome -> inspect element, but the iframe has no allowfullscreen attribute, after this code.

Thanks in advance,

like image 822
Danny Fox Avatar asked Jun 14 '12 13:06

Danny Fox


People also ask

How do I enable iframe in full screen?

Set to true if the <iframe> can activate fullscreen mode by calling the requestFullscreen() method. Note: This attribute is considered a legacy attribute and redefined as allow="fullscreen" .

Is iframe deprecated?

Overview. The widget is considered deprecated. If you need to use an IFrame, consider the "IFrame Component" widget The Iframe can be used to embed websites in the client.

What is Allowfullscreen?

Allows the HTML Component to be put into full screen mode. By default, users cannot place the HTML Component in full screen mode. Calling this function allows a user to place the HTML Component in full screen mode.

How many iframes can a page have?

Except that there is a higher resource demand and other performance issues there is no fixed limitation for those tags on one page.


1 Answers

iframe.setAttribute('allowFullScreen', '')

like image 85
Aelios Avatar answered Oct 22 '22 15:10

Aelios