Skip to content

Instantly share code, notes, and snippets.

@slifin
Last active August 29, 2015 14:17
Show Gist options
  • Save slifin/9bf9ec60048737f80162 to your computer and use it in GitHub Desktop.
Save slifin/9bf9ec60048737f80162 to your computer and use it in GitHub Desktop.
Dynamic ad container resizing
<img id="ad" src="http://aka-cdn-ns.adtechus.com/images/5205_gamezone_source_728x90_r1.jpg" alt="Adtech Ad" border="0"/>
<script type="text/javascript">
(function(){
'use strict';
var container = window.parent.document.getElementById('focus-enclose'),
ad = document.getElementById('ad');
if (ad&&container)
container.style.height = ad.offsetHeight+'px';
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment