[Javascript] help please with a menu system
Herzner, Daniel
DHerzner at pequotcap.com
Wed May 9 08:27:54 CDT 2001
Hi Group, I found a script on dynamicdrive.com that creates a nav menu that
slides out from the left side of the page
(http://www.dynamicdrive.com/dynamicindex1/slideinlink.htm). I love this
script and want to use it on my Intranet. The thing is I need to have
several instances of the menu like this:
Menu1
Menu2
Menu3
So, to try and do that I've created separate functions for creating the menu
object (leaving everything else the way it is):
function menuInit(){
oMenu=new makeMenu('divMenu')
scrolled=n?"window.pageYOffset":"document.body.scrollTop"
oMenu.css.left=-oMenu.width+lshow
ltop=(n)?oMenu.css.top:oMenu.css.pixelTop;
oMenu.css.visibility='visible'
if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();
}
function menuInit1(){
oMenu=new makeMenu('divMenu1')
scrolled=n?"window.pageYOffset":"document.body.scrollTop"
oMenu.css.left=-oMenu.width+lshow
ltop=(n)?oMenu.css.top:oMenu.css.pixelTop;
oMenu.css.visibility='visible'
if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();
}
In the body tag I've loaded the functions MenuInit & MenuInit1. Trouble is,
only the last function to load is the one being called no matter which menu
I click on. Obviously I'd like to minimize the code behind this nav system
so I need to know if I'd be able to create multiple menus reusing the other
functions on this page. Thank you everyone in advance.....
Daniel Herzner
203-429-2294
dherzner at pequotcap.com
pickledpunk at usa.com
More information about the Javascript
mailing list