Skip to content

Instantly share code, notes, and snippets.

@yeco
Last active December 15, 2015 17:38
Show Gist options
  • Select an option

  • Save yeco/5297397 to your computer and use it in GitHub Desktop.

Select an option

Save yeco/5297397 to your computer and use it in GitHub Desktop.
function addIframeStyle(styleUrl) {
var ss = document.createElement("link");
ss.type = "text/css";
ss.rel = "stylesheet";
ss.href = styleUrl;
var iframe = document.getElementById('frame_content');
var idoc = iframe.contentDocument || iframe.contentWindow.document;
if(document.all) {
idoc.createStyleSheet(ss.href);
} else {
idoc.getElementsByTagName("head")[0].appendChild(ss);
}
}
addIframeStyle(this.domain + "/css/quizzify_content_shared.css");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment