I hope someone on here can help me out.
I have a script that I been using to load my iframe and resize to the window size. I been trying to add in a script that will allow me to make the Iframe target a content page but cannot get them both to run together correctly. Seams every script I try it overrides my resize script.
The <head> script for resizing is:
<script src="css/dw_viewport.js" type="text/javascript"></script>
<script type="text/javascript">
function setIframeHeight(id, h) {
var main = document.getElementById(id);
if (main) {
var winHt = dw_Viewport.getWinHeight();
main.style.height = Math.round( h * winHt ) + "px";
main.style.marginTop = Math.round( ( winHt - parseInt(ifrm.style.height) )/2 ) + "px";
}
}
window.onload = function() { setIframeHeight('main', .7); }
window.onresize = function() { setIframeHeight('main', .7); }
The <head> script for loading a new target page to iframe is:
<script type="text/javascript">
function loadIframe(){
if (location.search.length > 0){
url = unescape(location.search.substring(1))
window.frames["main"].location=url
}
}
onload=loadIframe
</script>
I use the external link to load my page with targeted iframe is:
<a href="index.html?content.html">my content</a>
My Iframe:
<iframe name="main" id="main" src="index.html" allowtransparency="true" frameborder="0">Your browser doesn't allow viewing frames!</iframe>
If someone has a better script or can show me how to apply these 2 script to run together id appreciate it.
I have searched about adding multiple scripts but after trial and error I still didn't get any further.
Thanks


Reply With Quote


Bookmarks