Problem with tooltips and frames

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
stuart
Advanced
Advanced
Posts: 14
Joined: Sat Aug 20, 2005 7:35 pm

Problem with tooltips and frames

Post by stuart »

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: Select all

<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: Select all

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();");
}
Then the submenus open for all but the Synod menu

Any help greatly appreciated.

Stuart
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Stuart

The problem is that in the following code

Code: Select all

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
Post Reply