PDA

View Full Version : Code



alex126
10-07-2005, 11:39 AM
I need a code that when you open the index page it resizes


So i go to my site at www.spyonline.co.uk then it will resize to a intro then when i click eneter it will go to normal

Mentor
10-07-2005, 02:34 PM
There javascript doesnt appear to have any effect in firefox, yet if you mean say the window resives to be smaller or larger etc, this javascript should do the job


Ad this in the header


<script language=JavaScript>
<!--
function resizeOuterTo(w,h) {
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
top.outerWidth=w;
top.outerHeight=h;
}
else top.resizeTo(w,h);
}
}
//-->
</script>



Then in the body tag ad the exstra atribute onLoad="resizeOuterTo(600,450)"

so your new body tag may be


<body onLoad="resizeOuterTo(600,450)">

just replace the 6000 and 450 with the page size you want resized to, Width,Height


<body onLoad="resizeOuterTo(Width,Height)">

Want to hide these adverts? Register an account for free!