PDA

View Full Version : A Question about Tab Menu (mouseover)



Pandora's Box
09-09-2005, 03:05 PM
I just have a question. This is the link to the menu:
http://www.dynamicdrive.com/dynamicindex1/tabmouseover.htm

My script is here. I can't get it to load for some reason or other.

<html>
<head>
<title>Demographic Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>

<body bgcolor="#CCCCCC" background="Pictures/Background.jpg" text="#660000" link="#FF0000" vlink="#FF0000" alink="#FF0000">
&nbsp; &nbsp;
<h2><a href="http://www.javascriptkit.com" onMouseover="showit(0)">Age Distributions</a> | <a href="http://freewarejava.com" onMouseover="showit(1)">Age Trends</a> | <a href="http://freewarejava.com" onMouseover="showit(2)">Comorbidities</a> | <a href="http://freewarejava.com" onMouseover="showit(3)">Diagnosis</a>| <a href="http://freewarejava.com" onMouseover="showit(5)">Percentage Age Trends</a>| <a href="http://freewarejava.com" onMouseover="showit(4)">Sex Ratios</a><br>
</h2>
<ilayer width=400 height=400 name="dep1" bgColor="FFFFCC">
<layer name="dep2" width=135 height=600>
</layer>
</ilayer>
<div id="describe" style="background-color:FFFFCC;width:200px;height:1400px" onMouseover="clear_delayhide()" onMouseout="resetit(event)"></div>


<script language="JavaScript1.2">

/*
Tabs Menu (mouseover)- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/

var submenu=new Array()

submenu[0]=<font size="2" face="Verdana"><b><a href="http://www.javascriptkit.com/cutpastejava.shtml">Age Distribution of All RRT</a> <p></p> <a href="http://www.javascriptkit.com/javaindex.shtml">Age Distribution of HD patients</a> <p></p> <a href="http://www.javascriptkit.com/javatutors/index.shtml">Age Distribution of New HD patients</a> <p></p> <a href="http://www.javascriptkit.com/java/">New PD patients</a> <p></p> <a href="http://www.javascriptkit.com/howto/">New RTx Patients</a><p></p> <a href="http://www.javascriptkit.com/javaindex.shtml">Age Distribution of PD patients</a> <p></p> <a href="http://www.javascriptkit.com/javaindex.shtml">Age Distribution of Transplant patients</a> </b></font>

submenu[1]='<font size="2" face="Verdana"><b><a href="http://freewarejava.com/applets/index.shtml">Age Trends of Patients - RTx</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Age Trends of Patients - HD</a> <p></p> <a href="http://freewarejava.com/javasites/index.shtml">Age Trends of Patients Commencing on HD</a> <p></p> <a href="http://freewarejava.com/jsp/index.shtml">Age Trends of Patients commencing on PD</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Age Trends of Patients commencing on RRTs</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Age Trends of Patients commencing on RTx</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Age Trends of Patients, All RRT</a></b></font>

submenu[2]='<font size="2" face="Verdana"><b><a href="http://freewarejava.com/applets/index.shtml">Comorbidities - HBV</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Comorbidity - Hepatitis Status</a> <p></p> <a href="http://freewarejava.com/javasites/index.shtml">Comorbidities - HCV</a></b></font>

submenu[3]='<font size="2" face="Verdana"><b><a href="http://freewarejava.com/applets/index.shtml">Diagnosis - Disgnotic distribution of primary GN</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Diagnosis - DM as Comorbidity - PD patients</a> <p></p> <a href="http://freewarejava.com/javasites/index.shtml">Diagnosis - DM as comorbidity - All RRT</a> <p></p> <a href="http://freewarejava.com/jsp/index.shtml">Diagnosis - Existed RRT patients</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Diagnosis - Glomerulonephritis</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Diagnosis - Summary</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Diagnosis - new patients on RRT</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Diagnosis - Trends in Diabetes among RRT patients</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml"></a></b></font>

submenu[4]='<font size="2" face="Verdana"><b><a href="http://freewarejava.com/applets/index.shtml">Set Distribution - Summary</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Sex Ration - All RRTs</a> <p></p> <a href="http://freewarejava.com/javasites/index.shtml">Sex Ratio - HD</a> <p></p> <a href="http://freewarejava.com/jsp/index.shtml">Sex Ratio - Renal Transplant</a></b></font>

submenu[5]='<font size="2" face="Verdana"><b><a href="http://freewarejava.com/applets/index.shtml">Percentage Trend of New Patients</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Percentage Age Trends - Existed Patients</a></b></font>
//Set delay before submenu disappears after mouse moves out of it (in milliseconds)
var delay_hide=500

/////No need to edit beyond here

var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""

function showit(which){
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}

function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}

function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

</script>
</body>
</html>

Pandora's Box
09-10-2005, 09:54 AM
Bump. I need it quick.

Jule
09-10-2005, 10:02 AM
Hi! I'm not sure, but try this:

You left out a maybe important little bit: '
at the end of each submenu.

And be sure to have every submenu IN ONE LINE ! This means no spaces!

submenu[4]='<font size="2" face="Verdana"><b><a href="http://freewarejava.com/applets/index.shtml">Set Distribution - Summary</a> <p></p> <a href="http://freewarejava.com/tutorials/index.shtml">Sex Ration - All RRTs</a> <p></p> <a href="http://freewarejava.com/javasites/index.shtml">Sex Ratio - HD</a> <p></p> <a href="http://freewarejava.com/jsp/index.shtml">Sex Ratio - Renal Transplant</a></b></font>'

Pandora's Box
09-10-2005, 10:15 AM
Thanksalot! Never noticed that.
They're all in one line. The " ' " fixed it, though.

(And if you're wondering why I'm using the default sites...thats because the sites aren't for the world to look at! Whatever...)