2,290 MEMBERS
   158 DEV LOGS
Forgot your password? Click here
Bot Cat Hazei Isnizal Zuhri JoeOfTex Mag'nus
11 Online Discord

Fullscreen button for your embedded games

Posted: 2017-06-11 20:42:40 |    Posted by iDev |    idevgames.co.uk

Login to like

If you want to add a fullscreen button when embedding a game onto your site just use the code below. This javascript button will work on any iframe so you could edit the onclick="goFullscreen('embededGame'); by editing the 'embededGame' to the id of your iframe. 


Add the below HTML button and Javascript on the same page as the embedded game:

<button onclick="goFullscreen('embededGame'); return false">Fullscreen</button>
function goFullscreen(id) {
    var element = document.getElementById(id);
    if (element.mozRequestFullScreen) {
    } else if (element.webkitRequestFullScreen) {

Would you like to comment on this post? Create an account in less then 1 minute Click here

Back to top