Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Great menu ... small problem 1

Status
Not open for further replies.
Try this:

Change the stuff in the body of the page to this (to get you started):

Code:
<div id=&quot;divMenu1&quot; style=&quot;position:absolute; top:250; left:30; visibility:hidden; background-color:F0F0F0&quot;>
<nobr>
	<a href=&quot;[URL unfurl="true"]http://www.dynamicdrive.com&quot;>Dynamic[/URL] Drive</a> -
	<a href=&quot;[URL unfurl="true"]http://www.freewarejava.com/cgi-bin/Ultimate.cgi&quot;>WA[/URL] Help Forum</a> - 
	<a href=&quot;[URL unfurl="true"]http://active-x.com/&quot;>Active-X.com</a>[/URL] - 
	<a href=&quot;javascript://&quot; onclick=&quot;moveMenu(1)&quot; style=&quot;background-color:yellow;text-decoration:none&quot;>MENU</a>
</nobr>
</div>
<P>Neat -- you can embed these menus anywhere!</P>
<div id=&quot;divMenu2&quot; style=&quot;position:absolute; top:270; left:30; visibility:hidden; background-color:F0F0F0&quot;>
<nobr>
	<a href=&quot;[URL unfurl="true"]http://cdsdemo1.cdocs.com/informa/start.htm&quot;>Informa</a>[/URL] -
	<a href=&quot;[URL unfurl="true"]http://developer.irt.org/script/1525.htm&quot;>IRT</a>[/URL] - 
	<a href=&quot;javascript://&quot; onclick=&quot;moveMenu(2)&quot; style=&quot;background-color:yellow;text-decoration:none&quot;>MENU2</a>
</nobr>
</div>

Then, change the &quot;menuInit() function to this:

Code:
function menuInit()
{
    var oMenu;
	oMenu1=new makeMenu('divMenu1')
        if (n||ns6) scrolled=&quot;window.pageYOffset&quot;
        else if (ie) scrolled=&quot;document.body.scrollTop&quot;
	oMenu1.css.left=-oMenu1.width+lshow
        if (n||ns6) ltop=oMenu1.css.top
        else if (ie) ltop=oMenu1.css.pixelTop
	oMenu1.css.visibility='visible'
	oMenu2=new makeMenu('divMenu2')
        if (n||ns6) scrolled=&quot;window.pageYOffset&quot;
        else if (ie) scrolled=&quot;document.body.scrollTop&quot;
	oMenu2.css.left=-oMenu2.width+lshow
        if (n||ns6) ltop=oMenu2.css.top
        else if (ie) ltop=oMenu2.css.pixelTop
	oMenu2.css.visibility='visible'
	if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();
}

And change your &quot;moveMenu()&quot; function to this:

Code:
function moveMenu(whichMenu){
    if(whichMenu==1)
    {
      oMenu = oMenu1;
    }
    else if (whichMenu==2)
    {
      oMenu = oMenu2;
    }

	if(!oMenu.state){
		clearTimeout(tim)
		mIn()	
	}else{
		clearTimeout(tim)
		mOut()
	}
}

You can use changes like this to make as many menus as you like. I LOVE this script, BTW-- I may have to use it sometime! Thanks!!!
 
Thank you SO much ... it works fantastically!!!!

one more boon to ask of you, or anyone ...
is there anyway to have an open menu 'close' when you open a different one?

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top