Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:33
Problem with tooltips and frames
Poster: stuart
Dated: Saturday September 10 2005 - 22:33:53 BST
I'm having a problem with using tooltips when I have a frames layout
My header frame code is as below. I have just one tooltip at the moment and as far as I can see this is basically the same as the tooltips sample.
However with this code the submenus do not open.
Code:
<html>
<head>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script>
function load_contents(display)
{
if (display == "WhatsNew")
{
parent.contents.mm_closeAllmenus();
parent.contents.WhatsNew.style.display = ""
}
else
{
parent.contents.WhatsNew.style.display = "none";
parent.contents.mm_showMenu(display,1)
}
}
</script>
<link rel="stylesheet" type="text/css" href="methodistscotland.css">
</head>
<body topmargin="0" leftmargin="0" >
<img border="0" src="images/MethScot.gif" width="646" height="60" alt="The MEthodist Church in Scotland Text">
<script>_menuCloseDelay=0;
_menuOpenDelay=0;
_subOffsetTop=-60;
_subOffsetLeft=0;
with(headerStyle=new mm_style()){
oncolor="#FFFFFF";
onbgcolor="#D70B0B";
offcolor="#FFFFFF";
offbgcolor="#006699";
padding="3";
separatorsize="1";
borderwidth="1";
fontfamily="verdana";
fontsize="14px";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90)";
borderstyle="solid";
pagebgcolor="#FED66C";
}
with(milonic=new menuname("Main Menu")){
style=headerStyle;
alwaysvisible="1";
orientation="1";
top="60";
left="0";
aI("text=Home;url=http://localhost/methodists.org/main.asp?MenuReset=DoIt;showmenu=Home;target=main;clickfunction=javascript:load_contents(\"WhatsNew\");pagematch=/main.asp;");
aI("text=Synod;url=http://localhost/methodists.org/synod_main_page.asp;showmenu=Synod;target=main;clickfunction=javascript:load_contents(\"Synod\");pagematch=/synod_main_page.asp;onfunction=showtip('Synod main page');");
aI("text=Our Calling;showmenu=Our Calling;target=main;");
aI("text=Prayer without Ceasing;showmenu=Prayer without Ceasing;target=main;");
}
drawMenus()</script>
<script language=Javascript src="mm_navframe.js" type=text/javascript></script>
<script src="tooltips.js" type=text/javascript></script>
</body>
</html>
<head>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script>
function load_contents(display)
{
if (display == "WhatsNew")
{
parent.contents.mm_closeAllmenus();
parent.contents.WhatsNew.style.display = ""
}
else
{
parent.contents.WhatsNew.style.display = "none";
parent.contents.mm_showMenu(display,1)
}
}
</script>
<link rel="stylesheet" type="text/css" href="methodistscotland.css">
</head>
<body topmargin="0" leftmargin="0" >
<img border="0" src="images/MethScot.gif" width="646" height="60" alt="The MEthodist Church in Scotland Text">
<script>_menuCloseDelay=0;
_menuOpenDelay=0;
_subOffsetTop=-60;
_subOffsetLeft=0;
with(headerStyle=new mm_style()){
oncolor="#FFFFFF";
onbgcolor="#D70B0B";
offcolor="#FFFFFF";
offbgcolor="#006699";
padding="3";
separatorsize="1";
borderwidth="1";
fontfamily="verdana";
fontsize="14px";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90)";
borderstyle="solid";
pagebgcolor="#FED66C";
}
with(milonic=new menuname("Main Menu")){
style=headerStyle;
alwaysvisible="1";
orientation="1";
top="60";
left="0";
aI("text=Home;url=http://localhost/methodists.org/main.asp?MenuReset=DoIt;showmenu=Home;target=main;clickfunction=javascript:load_contents(\"WhatsNew\");pagematch=/main.asp;");
aI("text=Synod;url=http://localhost/methodists.org/synod_main_page.asp;showmenu=Synod;target=main;clickfunction=javascript:load_contents(\"Synod\");pagematch=/synod_main_page.asp;onfunction=showtip('Synod main page');");
aI("text=Our Calling;showmenu=Our Calling;target=main;");
aI("text=Prayer without Ceasing;showmenu=Prayer without Ceasing;target=main;");
}
drawMenus()</script>
<script language=Javascript src="mm_navframe.js" type=text/javascript></script>
<script src="tooltips.js" type=text/javascript></script>
</body>
</html>
If I change the synod item to
Code:
with(milonic=new menuname("Main Menu")){
style=headerStyle;
alwaysvisible="1";
orientation="1";
top="60";
left="0";
aI("text=Home;url=http://localhost/methodists.org/main.asp?MenuReset=DoIt;showmenu=Home;target=main;onfunction=openSubmenu();offfunction=closeSubmenu();clickfunction=javascript:load_contents(\"WhatsNew\");pagematch=/main.asp;");
aI("text=Synod;url=http://localhost/methodists.org/synod_main_page.asp;showmenu=Synod;target=main;onfunction=openSubmenu();offfunction=closeSubmenu();clickfunction=javascript:load_contents(\"Synod\");pagematch=/synod_main_page.asp;onfunction=showtip('Synod main page');");
aI("text=Our Calling;showmenu=Our Calling;target=main;onfunction=openSubmenu();offfunction=closeSubmenu();");
aI("text=Prayer without Ceasing;showmenu=Prayer without Ceasing;target=main;onfunction=openSubmenu();offfunction=closeSubmenu();");
}
style=headerStyle;
alwaysvisible="1";
orientation="1";
top="60";
left="0";
aI("text=Home;url=http://localhost/methodists.org/main.asp?MenuReset=DoIt;showmenu=Home;target=main;onfunction=openSubmenu();offfunction=closeSubmenu();clickfunction=javascript:load_contents(\"WhatsNew\");pagematch=/main.asp;");
aI("text=Synod;url=http://localhost/methodists.org/synod_main_page.asp;showmenu=Synod;target=main;onfunction=openSubmenu();offfunction=closeSubmenu();clickfunction=javascript:load_contents(\"Synod\");pagematch=/synod_main_page.asp;onfunction=showtip('Synod main page');");
aI("text=Our Calling;showmenu=Our Calling;target=main;onfunction=openSubmenu();offfunction=closeSubmenu();");
aI("text=Prayer without Ceasing;showmenu=Prayer without Ceasing;target=main;onfunction=openSubmenu();offfunction=closeSubmenu();");
}
Then the submenus open for all but the Synod menu
Any help greatly appreciated.
Stuart
Poster: kevin3442
Dated: Sunday September 11 2005 - 12:19:52 BST
Hi Stuart
The problem is that in the following code
Code:
aI("text=Synod;url=http://localhost/methodists.org/synod_main_page.asp;showmenu=Synod;target=main;onfunction=openSubmenu();offfunction=closeSubmenu();clickfunction=javascript:load_contents(\"Synod\");pagematch=/synod_main_page.asp;onfunction=showtip('Synod main page');");
you have two onfunctions defined. You can only have one. If you want the mouseover to trigger two different functions, then you should make a "wrapper function" that calls the other two functions. Pass the necessary parameters in the call to the wrapper function, then pass them again from there to the other two functions.
BTW, you do not need the "javascript:" part in the argument to the clickfunction property.
Hope that helps,
Kevin