PDA

View Full Version : Switch visable DIV


smoker
02-04-2003, 06:57 PM
Let me start by thanking everyone who has responded to my previous posts. I have come a long way since I started this project. Here is the code I have written so far
<SCRIPT LANGUAGE="JavaScript">
function page1change()
{
document.all.page1.style.visibility="visible";
document.all.page2.style.visibility="hidden";
document.all.page3.style.visibility="hidden";
}
function page2change()
{
document.all.page1.style.visibility ="hidden";
document.all.page2.style.visibility ="visible";
document.all.page3.style.visibility ="hidden";
}
function page3change()
{
document.all.page1.style.visibility="hidden";
document.all.page2.style.visibility="hidden";
document.all.page3.style.visibility="visible";
}
</SCRIPT>

<A HREF="javascript:page1change();">page1</a>
<A HREF="javascript:page2change();">page2</a>
<A HREF="javascript:page3change();">page3</a>
<DIV ID="page1" STYLE="position:absolute;
top: 10%; left: 0%; z-index: 0; width: 200px;
height: 200px; visibility:visible">
Page1
</DIV>
<DIV ID="page2" STYLE="position:absolute;
top: 10%; left: 0%; z-index: 0; width: 200px;
height: 200px; visibility:hidden">
Page2
</DIV>
<DIV ID="page3" STYLE="position:absolute;
top: 10%; left: 0%; z-index: 0; width: 200px;
height: 200px; visibility:hidden">
Page3
</DIV>

This uses layers and javascript to preload 3 three pages and let me switch between them instantly. What i need to do now is make those 3 pages phpbb forums. So I guess what I'm asking is can I load an entire page in a div layer? If not how else could I accomplish this. When I load the forums i need them to be running from there remote directories because the paths are already set to run from their remote directories. If anyone has any idea on the next step i should take or any suggestions please dont hesitate. Thanks again for all of your help
-Smoker

Jon Hanlon
02-05-2003, 04:48 PM
You need to use IFRAMEs if you want other pages.
See http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/iframe.asp