mdcloud
03-18-2006, 04:07 PM
what i need to know is what syntax to use in the
window.location.replace("secondnav1024.html")
the current code loads the html page but does by taking the whole thing to that page, not by just loading the html in the layer i need it to. what is the commands for doing this load?
please help
you can not load a page into a layer. There are various methods to solve the problem, the simplier one is to use an iframe and load there the pages.
...
onload = function{
if (screen.width==800||screen.height==600)
document.getElementById('iframeid').setAttribute('src','secondnav800.html');
....
...
}
...
adjust the iframe's attribute (border 0 , no scroll, etc....) so that it could look like a part of the page.
mdcloud
03-18-2006, 04:25 PM
Thanks for the reply. i dont think i can use iframe though. i am needing my navigation to be able to expand over my text.
here is my working page without resolution sniffer
http://www.beinhealth.com/test/contact.html
when i tried to use iframe i couldnt get text to display under menu like i want. do you think i could set up my page to say something like
if (screen.width==800||screen.height==600)
display(my flash object code)
if so, what would be the command to display ()
thanks for your help... new to this but getting it i think
mdcloud
03-18-2006, 05:52 PM
ok, i have been trying to figure out how to make my last post work.
here is what i got
else if (screen.width==1024||screen.height==768)
document.write("<OBJECT classid=" + "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + "codebase=" + "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
+ "WIDTH=" + "1000" + "HEIGHT=" + "300" + "id=secondnav ALIGN=top>" +
"<PARAM NAME=movie VALUE=http://codingforums.com/archive/index.php/secondnav.swf> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFCC33> <EMBED src=http://codingforums.com/archive/index.php/secondnav.swf quality=high wmode=transparent bgcolor=#FFCC33 WIDTH=" + "1000" + "HEIGHT=" + "300" + "NAME=secondnav ALIGN=top TYPE=application/x-shockwave-flash PLUGINSPAGE=" + "http://www.macromedia.com/go/getflashplayer" + "></EMBED> </OBJECT>" + ")")
basicly all the stuff in red is my flash object. everywhere in the flash object code there was a "" i had to go in and add a " + " to get it to read out with no errors. now it displays... yea! but it is about 1/4 size and i dont know why. i am sure there is a better way of doing this. is there a way to get the whole object code to display without having to break it up?
mdcloud
03-18-2006, 06:41 PM
ok,
i GOT IT !!!
here is the code i got to work. if you guys see anything i did wrong please let me know. as far as i know this is working correctly, but as i have said i am new to this
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</HEAD>
<body bgcolor="#FFCC33" text="#AF1F00" alink="#AF1F00" vlink="#AF1F00" link="#AF1F00">
<div id="Layer1" style="position:absolute; width:1200px; height:800px; z-index:2; visibility: visible; left: 25px; top: 11px;">
<script language="JavaScript1.2">
if (screen.width==640||screen.height==480)
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="600" HEIGHT="200" id="secondnav600" ALIGN="top"> <PARAM NAME=movie VALUE=http://codingforums.com/archive/index.php/"secondnav600.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFCC33> <EMBED src=http://codingforums.com/archive/index.php/"secondnav600.swf" quality=high wmode=transparent bgcolor=#FFCC33 WIDTH="600" HEIGHT="200" NAME="secondnav600" ALIGN="top" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> </OBJECT>')
else if (screen.width==800||screen.height==600)
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="800" HEIGHT="300" id="secondnav800" ALIGN="top"> <PARAM NAME=movie VALUE=http://codingforums.com/archive/index.php/"secondnav800.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFCC33> <EMBED src=http://codingforums.com/archive/index.php/"secondnav800.swf" quality=high wmode=transparent bgcolor=#FFCC33 WIDTH="800" HEIGHT="300" NAME="secondnav800" ALIGN="top" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></object>')
else if (screen.width==1024||screen.height==768)
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="1000" HEIGHT="300" id="secondnav" ALIGN="top"> <PARAM NAME=movie VALUE="http://codingforums.com/archive/index.php/secondnav.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFCC33> <EMBED src="http://codingforums.com/archive/index.php/secondnav.swf" quality=high wmode=transparent bgcolor=#FFCC33 WIDTH="1000" HEIGHT="300" NAME="secondnav" ALIGN="top" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> </OBJECT>')
else
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="1200" HEIGHT="400" id="secondnavother" ALIGN="top"> <PARAM NAME=movie VALUE=http://codingforums.com/archive/index.php/"secondnavother.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFCC33> <EMBED src=http://codingforums.com/archive/index.php/"secondnavother.swf" quality=high wmode=transparent bgcolor=#FFCC33 WIDTH="1200" HEIGHT="400" NAME="secondnavother" ALIGN="top" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>')
</script>
</div>
<div id="Layer2" style="position:absolute; width:800px; height:800px; z-index:1; visibility: visible;">
text
</div>
Came out pretty good. to see example go to
http://www.beinhealth.com/test/contact.html