Hi All,


Can any one please guide me how to draw my IFRAME based on window size. Thanks in advance....

Recommended Answers

JavaScript can do it. Ask over there.

Regards
Arkinder

Jump to Post

All 2 Replies

JavaScript can do it. Ask over there.

Regards
Arkinder

demo

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<script type="text/javascript">
<!--
function sizer() {
var viewportheight;
if (typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight }
else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportheight = document.documentElement.clientHeight }
else { viewportheight = document.getElementsByTagName('body')[0].clientHeight }
document.getElementById('extern').style.height=viewportheight-26 + 'px'; }
document.onresize = sizer(); 
//--></script>
<!--[if IE]>
<script type='text/javascript'>window.onresize=sizer;</script>
<![endif]-->
<title>page</title>
</head>
<body onload='sizer();' style='margin:0;padding:0;height:100%;text-align:center;'>
<div style='height:23px;width:100%;text-align:center;'>
<a href='home.html'>&nbsp;Return to referring&nbsp;page&nbsp;</a></div>
<iframe name='extern' id='extern' frameborder='0' width='100%' height='200px' src='whatever.htm'>loading frame</iframe></body></html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.