Skip to content

Instantly share code, notes, and snippets.

@philippeowagner
Forked from iros/fullscreen.js
Last active August 29, 2015 14:09
Show Gist options
  • Save philippeowagner/44e690e0b7e795a37a00 to your computer and use it in GitHub Desktop.
Save philippeowagner/44e690e0b7e795a37a00 to your computer and use it in GitHub Desktop.
if (document.body.requestFullscreen ||
document.body.mozRequestFullScreen ||
document.body.webkitRequestFullscreen
) {
$("<button>View this chart in Full Screen</button>")
.on('click', function (e) {
var root = $interactive.get(0);
if (root.requestFullscreen) { root.requestFullscreen(); }
else if (root.mozRequestFullScreen) { root.mozRequestFullScreen(); }
else if (root.webkitRequestFullscreen) { root.webkitRequestFullscreen(); }
e.preventDefault();
})
.appendTo($interactive);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment