Created
August 21, 2014 23:34
-
-
Save themorgantown/cbae9330b3e33617b328 to your computer and use it in GitHub Desktop.
my gist description
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
<script type="text/javascript"> | |
window.onresize = function(event) { | |
// Input the Width and the Height of your original document. Just Numbers! | |
var ratioScale = 1108 / 831; | |
// get the width of the enclosing Div for the Hype element | |
var currentWidth = document.getElementById('container').offsetWidth; | |
// Use the width of the Div, and divide it by the Ratio of the W/H of the document | |
// and set this as the variable for the height of the Iframe. | |
var iFrameNewHeight = currentWidth / ratioScale; | |
// set the iframe to have the correct height. | |
document.getElementById('hypeFrame').style.height = iFrameNewHeight + "px"; | |
};</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment