View this code at http://livecoding.io/11152542
-
-
Save andrewbtran/11152542 to your computer and use it in GitHub Desktop.
created by http://livecoding.io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"libraries": [], | |
"mode": "javascript", | |
"layout": "fullscreen mode (vertical)", | |
"resolution": "reset" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* css goes here */ | |
.embed-container { | |
position: relative; | |
padding-bottom: 56.25%; | |
padding-top: 30px; | |
margin:15px 0; | |
overflow: hidden; | |
max-width: 100%; | |
height: auto; } | |
.embed-container iframe, .embed-container object, .embed-container embed { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- html goes here --> | |
<div id="embed-container" > </div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* javascript goes here */ | |
var width = $(window).width(); // grab the window width | |
var smallUrl= "http://graphics.boston.com/multimedia/graphics/andrew/rub/aha.html?gif=/multimedia/graphics/andrew/gifs/stripgif640.gif" | |
var largeUurl="http://graphics.boston.com/multimedia/graphics/andrew/rub/aha.html?gif=/multimedia/graphics/andrew/gifs/stripgif640.gif" | |
if (width < 480) | |
var src = smallURL; | |
else src = largeURL; | |
function createIframe(){ | |
var i = document.createElement("iframe"); | |
var a = Math.random() + ""; | |
var t = a * 10000000000000; | |
i.src = src; | |
i.scrolling = "auto"; | |
i.frameborder = "0"; | |
i.width = "100%"; | |
i.height = "100%"; | |
document.getElementById("embed-container").appendChild(i); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment