Frames Example | Page 1 |
This example shows how to use Pop-Up Menus in a frameset. At left is a frame
with links to a set of pages that will load in this frame. It also has
links that will cause pop-up menus to appear in this frame when moused over.
It's designed so that the menus always appear in the same position relative to the left-hand frame, so even if this frame is scrolled, the menus appear just to the right of those links. Page Setup The main page defines two frames and looks like this.
<html> <head> <title>Pop-Up Menus Frame Example</title> </head> <frameset cols="120,*" border=0 frameborder="no" framespacing=0> <frame name="tocFrame" src="framesToc.html" marginheight=0 marginwidth=0> <frame name="mainFrame" src="framesMain1.html"> </frameset> </html> Each of the first three pages all contain the following script includes:
<script language="JavaScript" src="popcond.js"></script> <script language="JavaScript" src="frameMenus.js"></script> popcond.js contains a condensed version of the code in dhtmllib.js and popupmenu.js for quicker download while frameMenus.js contains the actual menu definitions and some code to initialize them whenever the page loads. This way each of pages defines the same set of menus using the same variable names (menu1, menu2 and menu3). The last page has no menus, this is done to demonstrate how to handle a situation where you cannot or simply don't wish to add menus to a page that may be loaded in the frame. Now for the code in the left-hand frame...
Next
|