2

I'm writing code that generates a <iframe> so that other people can put this code on their sites, one of the functions of this <iframe> is requestFullscreen();

This request is working optimally, but it does not allow to do this in a cross domain.

Below is an image representing the structure of the elements.

enter image description here

PHP main page code

<div id="alpha">
    <a href="#">A simple full screen template</a>
</div>

JS code

$(document).ready(function(){

    $('a').click(function(){
        var screenresize = $('#alpha').get(0);
        screenresize.requestFullscreen();
        return false;
    });
});

Cross domain HTML/PHP code

<iframe src="http://experimental.devz/iframe.php"></iframe>

I know it's possible to do this because youtube also works the same way, although your code is scrambled, I know it does it or similar.

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141

1 Answers1

2

You will need an iframe with the attribute allow="fullscreen"

Set allow="fullscreen can activate fullscreen mode by calling the requestFullscreen() method.

See this iframe: The Inline Frame element

Example:

<iframe allow="fullscreen" src="http://experimental.devz/iframe.php"></iframe>
probitaille
  • 1,899
  • 1
  • 19
  • 37