by
294 13
0
4
3,091
0
Top 1% !
Popular
Famous
Specified
Popularity: 4595th place
Created
Modified Jul 24, 2013
This snippet is Public
No tags for this snippet yet.
LanguageJavaScript
LicenseMIT_X11
SourceGithub
SourceMyGists

Old Old autoSetFrameHeight

Old Old autoSetFrameHeight: 
autoSetFrameHeight.js
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/21118/Old-Old-autoSetFrameHeight?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
function autoSetFrameHeight(name) { try { var iframe; if (!name) return; iframe = document.getElementById(name); if (iframe.contentDocument) $("#" + name).height(iframe.contentDocument.height + "px"); else $("#" + name).height(document.frames[name].document.body.scrollHeight + "px"); } catch (e) { // alert(e.message); } }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus