PDA

View Full Version : Tabs Menu



shevi2027
03-20-2006, 01:41 PM
Hello

I am using this script.

http://www.dynamicdrive.com/dynamicindex1/tabmouseover.htm

I changed the code from :


<!--Links used to initiate the sub menus. Pass in the desired submenu index numbers (ie: 0, 1) -->
<a href="http://www.javascriptkit.com" onMouseover="showit(0)">JavaScript Kit</a> | <a href="http://freewarejava.com" onMouseover="showit(1)">Freewarejava</a><br>


to:


<!--Links used to initiate the sub menus. Pass in the desired submenu index numbers (ie: 0, 1) -->
<a href="http://www.javascriptkit.com" onClick="showit(0)">JavaScript Kit</a> | <a href="http://freewarejava.com" onMouseover="showit(1)">Freewarejava</a><br>


When i test it (with onClick) on Firefox (1.5) it works perfectly..But when i test it on Internet Explorer (6.0) it doesn't work at all..

Is this normal?? How can i use it??

Thank you.

jscheuer1
03-20-2006, 03:13 PM
<a href="http://www.javascriptkit.com" onclick="showit(0);return false;">JavaScript Kit</a> | <a href="http://freewarejava.com" onclick="showit(1);return false;">Freewarejava</a><br>

The above works here in IE6, I'm surprised it worked in FF the other way.

shevi2027
03-20-2006, 03:49 PM
wow it works ^^ thanks alot

And another question..On the OnLoad event i want the page to laod a selected menu..Anyway this works in FireFox but not in Internet Explorer..I tired putting the "return false;" to it as well to see if it work but nothing happened..

Can you help me??



<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onLoad="showit(2);setVariables();checkLocation();">


"setVariables();checkLocation();" are 2 other funcions i test..

Thank you.

shevi2027
03-20-2006, 04:16 PM
mmm well i have a problem.. ven though i said it worked before..
When i put the "return false;" the script below (my menu) doesn't work..It doesn't take me to the location i need..



<!-- lINKS -->
<td width="13%" height="25"><a href="../Home/home.html" onClick="showit(0);" style="text-decoration:none;"><span class="Menu1Title">Home</span></a></td>
<td width="14%" height="25"><a href="../Servizi/servizi.html" onClick="showit(1);" style="text-decoration:none;"><span class="Menu1Title">I Servizi</span></a></td>
<td width="17%" height="25"><a href="../Prodotti/prodotti.html" onClick="showit(2);" style="text-decoration:none;"><span class="Menu1TitleLoad">I Prodotti</span></a></td>
<td width="21%" height="25"><a href="../Area_Riservata/area_riservata.html" onClick="showit(3);" style="text-decoration:none;"><span class="Menu1Title">Area Riservata</span></a></td>
<td width="22%" height="25"><a href="../Area_Commerciale/area_comm.html" onClick="showit(4);" style="text-decoration:none;"><span class="Menu1Title">Area Commerciale</span></a></td>
<td width="13%" height="25"><a href="../Supporto/supporto.html" onClick="showit(5);" style="text-decoration:none;"><span class="Menu1Title">Supporto</span></a></td>

<!-- END LINKS -->


What can i do??

jscheuer1
03-20-2006, 05:50 PM
With something like:


<a href="../Home/home.html" onClick="showit(0);" style="text-decoration:none;"><span class="Menu1Title">Home</span></a>

If you add the return false:


<a href="../Home/home.html" onClick="showit(0);return false;" style="text-decoration:none;"><span class="Menu1Title">Home</span></a>

The link will not fire. If you leave it the way it was in the first place, the link will fire but, the event may not. If you want both to fire, use return true:


<a href="../Home/home.html" onClick="showit(0);return true;" style="text-decoration:none;"><span class="Menu1Title">Home</span></a>

As for your body onload issue, I can't see why that won't work off hand. I'll have to look the script over and may even need a link to your problem page to figure that one out.

jscheuer1
03-20-2006, 05:59 PM
Part two of a two part answer:

The onload thing should work (tested OK locally on a fresh page). I'd try (make sure there is a '2' configured and working using the normal method for this script first):


<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onLoad="showit(2);">

If that works, try:


<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onLoad="showit(2);setVariables();">

and:


<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onLoad="showit(2);checkLocation();">

to see if one or the other or both of the additional functions are to blame.