View this code at http://livecoding.io/11153212
-
-
Save andrewbtran/11153212 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 largeUrl= "http://graphics.boston.com/multimedia/graphics/andrew/rub/aha.html?gif=/multimedia/graphics/andrew/gifs/stripgif1232.gif" | |
if (width < 480) { | |
src = smallUrl; | |
} | |
else { | |
src = largeUrl; } | |
function createIframe(source){ | |
var iframe = document.createElement("iframe"); | |
iframe.src = source; | |
iframe.scrolling = "auto"; | |
iframe.frameborder = "0"; | |
iframe.width = "100%"; | |
iframe.height = "500px"; | |
document.getElementById("embed-container").appendChild(iframe); | |
}; | |
createIframe(src); |
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