|
|
Javascript menus and the FP "include" functionThe menu bar on this page came from: http://www.dynamicdrive.com/dynamicindex1/topnavbar.htm. a number of its parameters were modified to make it appear as an integrated element with the banner graphic. I have listed some of these steps at http://www.lehrercommunications.com/menu/bartest.htm, where you can also view the source code for the navbar. The entire banner appears on this page via the FP "include" function. The source of the included page is shown here: http://www.lehrercommunications.com/menu/banner.htm. By using the include function for the banner on every page in a site, I'll only have to make a single change if I ever want to change menu options throughout a site. The Javascript would not work if you simply included one page in another. However, following the suggestion of Laurel Nevans-Palmer, I included the script between the <body> and </body> of the included page, because FP ignores everything on an included page that is not in the body section. To make it work, you also have to include onload="init()" in the <body> tag of all the target pages, as shown: <body onload="init()" bgcolor="#FFFFFF" marginheight="0" topmargin="0"> I believe this page works equally well in Netscape and IE, but would appreciate feedback from anyone who has viewed it in either browser. And now that I've figured out how to do this, the next challenge is to put it into practice in one of the client sites I'm currently developing. There aren't enough hours in a day!! Jonathan
Lehrer |