Jump to content

menus, submenus and subsubmenus


countdrac

Recommended Posts

i am having problems and if anyone can point out what im doing wrong would be greatly appreciated.

 

this is from my php file...

 

echo "<dl>";

      echo "<dt onmouseover=javascript:showSMenu(); onmouseout=javascript:hideSMenu();>Archives</dt>";

 

$menuNum=1;

for ($count=10;$count<20;$count++)

{

echo "<dl><dt id='smenu".$menuNum."' onmouseover=javascript:showSSMenu('ssmenu".$menuNum."'); onmouseout=javascript:hideSMenu();>".$count."</dt>";

echo "<dd id='ssmenu".$menuNum."' onmouseout=javascript:showSSMenu('');>";

echo "<ul>";

loadList($count,$mainArray,$i);

echo "</ul></dd></dl>";

$menuNum++;

}

echo "</dl>";

 

and this is the javascript:

 

window.onload=hideSMenu;

window.onload=showSSMenu;

 

function showSMenu()

{

for (var i = 0; i <= 10; i++)

{

document.getElementById('smenu'+i).style.display='block';

}

}

 

function showSSMenu(id)

{

var d = document.getElementById(id);

for (var i = 0; i <= 10; i++)

{

document.getElementById('ssmenu'+i).style.display='none';

}

if(d)

{

d.style.display='block';

}

}

 

function hideSMenu()

{

for (var i = 0; i <= 50; i++)

{

if (document.getElementById('smenu'+i))

{

document.getElementById('smenu'+i).style.display='none';

}

}

}

 

thanks

dave

Link to comment
https://forums.phpfreaks.com/topic/74561-menus-submenus-and-subsubmenus/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.