Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
:-webkit-full-screen .gist {
overflow-y:auto;
}
// include.js
// ----------
// Code for included the full screen code snippets on your site
var s = document.createElement('script');
s.src = 'https://raw.github.com/gist/3784818/c69646def2328f589aeb632615cdca099ec80c62/snippets.js';
document.getElementsByTagName('head')[0].appendChild(s);
// full screen code snippets
(function() {
"use strict";
function addCss() {
var css = 'html:-webkit-full-screen .gist, html:fullscreen { height: 100%; overflow:auto; width: 100%; }';
var styleTag = document.createElement('style');
styleTag.innerHTML = css;
document.getElementsByTagName('head')[0].appendChild(styleTag);
}
function fullScreenerise(gist) {
// addCss();
gist.addEventListener('click', function() {
if (gist.requestFullScreen) {
gist.requestFullScreen();
} else if (gist.mozRequestFullScreen) {
gist.mozRequestFullScreen();
} else if (gist.webkitRequestFullScreen) {
gist.webkitRequestFullScreen();
}
}, true);
}
if (document.querySelectorAll) {
var gists = document.querySelectorAll('.gist');
for (var i = 0, length = gists.length; i < length; i++) {
fullScreenerise(gists[i]);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.