Skip to content

Instantly share code, notes, and snippets.

Created September 11, 2010 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/575445 to your computer and use it in GitHub Desktop.
Save anonymous/575445 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Titre</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css">
* {
margin: 0px;
padding: 0px;
}
#header {
height: 100px;
background: #eee;
}
#frame {
border: none;
width: 100%;
}
</style>
<script type="text/javascript">
var frame;
var headerHeight = 100;
function height() {
if( typeof( window.innerWidth ) == 'number' )
return window.innerHeight;
else if( document.documentElement && document.documentElement.clientHeight )
return document.documentElement.clientHeight;
}
window.onload = function() {
frame = document.getElementById('frame');
updateFrameHeight();
};
window.onresize = function() {
updateFrameHeight();
};
function updateFrameHeight() {
frame.style.height = (height() - headerHeight - 5)+"px";
}
</script>
</head>
<body>
<div id="header">
Mon site
</div>
<iframe src="http://www.commentcamarche.net" id="frame" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment