![]() |
Ok, here are the complete, step by step instructions
for installing this script. Use the menu at the left to navigate to the various sections.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Float Menu (Static Menu)</title>
<!--- *** BEGIN CUT - Demo starts here *** --->
<!--- *** Another xLayer demo from www.Roy.Whittle.com *** --->
<SCRIPT LANGUAGE="JavaScript" SRC="javascript/xLayer.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="javascript/xBrowser.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="javascript/staticMenu.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function start()
{
CreateStaticMenu("MenuDiv", 10, 10);
}
</SCRIPT>
<!--- *** END CUT - Demo ends here *** --->
</head>
<BODY bgcolor="black" TEXT="white" LINK="yellow" VLINK="yellow" ALINK="red" onLoad="start()">
<CENTER>
<FONT FACE="Arial" SIZE="5">
Brought to you by... </FONT> <br>
<FONT FACE="Arial"> <A HREF="http://www.Roy.Whittle.com" TARGET="_blank">JavaScript Gadgets'n'Gizmos</A> </FONT>
</CENTER>
<TABLE>
<TR>
<!-- *** Set this width to the gap you want on the left of your page *** -->
<TD><IMG SRC="images/spacer.gif" WIDTH="130"></TD>
<!-- *** Put content here that would normally be in the BODY of you document *** -->
<TD> <FONT FACE="Arial">
In order for the menu to work effectively you need to leave a border at
the left of your page. This is no problem. Simply create a table with
2 columns, Make the left column wide enough to allow the menu to scroll
without obscuring content then just put the content of your page in the
right column of the table. I have made this page simple so you can view
the source to understand what is going on. Also, here are the complete
<A HREF="instructions.html">instructions</A> on how to install this script.
<P> To see how this script works, scroll down the page. </P> </FONT>
</TD>
</TR>
</TABLE>
<!-- *** START - Here is the menu, make it as fancy as you like *** --->
<DIV id="MenuDiv" STYLE="position:absolute;left:10;top:10;width:100;">
<TABLE BORDER="2" WIDTH="100" BGCOLOR="#336699">
<TR>
<TD align="center">
<FONT FACE="Arial" SIZE=5>MENU</FONT>
</TD>
</TR>
<TR>
<TD align="center">
<A HREF="#">Home</A><br>
<A HREF="#">Email</A><br>
<A HREF="#">Gadgets</A><br>
<A HREF="#">Gizmos</A><br>
<A HREF="#">Links</A><br>
</TD>
</TR>
</TABLE>
</DIV>
<!-- *** END - the menu, make is as fancy as you like *** --->
</body>
</html>
The first step is to DOWNLOAD staticmenu.zip
and extract all the contents into a test directory. xLayer.js These are text files that contain the code to move the layer that contains
the menu. <SCRIPT LANGUAGE="JavaScript" SRC="javascript/xLayer.js"></SCRIPT> The "SRC=" points to where the javascript files are. In this
case all the files are in the This next part is required to tell the script where the menu "DIV"
is and where to <SCRIPT LANGUAGE="JavaScript"> In order for the menu to move and always be at the same position on the
page you need <BODY bgcolor="black" TEXT="white" LINK="yellow" VLINK="yellow" ALINK="red"
onLoad="start()"> In this case the onLoad="start()" will start the javascript that makes the menu move. Next you need to design your web page so you leave a column at the left
of the page <TABLE> This is you web content </TD> We use a spacer gif to ensure the left table column stays wide enough
to fit the menu. The last thing is to define the layer in which the menu exists. You do
this using an "absolute" <DIV id="MenuDiv" STYLE="position:absolute;left:10;top:10;width:100;"> Anything defined here will be your float menu. </DIV> The following . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |