Skip to content

Instantly share code, notes, and snippets.

@iros
Created November 21, 2013 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iros/7584424 to your computer and use it in GitHub Desktop.
Save iros/7584424 to your computer and use it in GitHub Desktop.
Full screening
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