Created
June 28, 2013 09:55
-
-
Save vdite/5883669 to your computer and use it in GitHub Desktop.
Collapse iframe if empty with jQuery
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
// if you are using no caching headers in your iframe sources, so you 'll always get an "filled" iframe. This does kick your layout sometimes. | |
// this is how to coollapse such iframes: | |
if($("#iframeid").contents().find("p").length) { | |
$('#iframeid').css('display', 'none'); | |
} | |
// this is how to kill all caches in the iframe source | |
// <head> | |
// <meta http-Equiv="Cache-Control" Content="no-cache"> | |
// <meta http-Equiv="Pragma" Content="no-cache"> | |
// <meta http-Equiv="Expires" Content="0"> | |
// </head> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment