[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

Javascript Pull Out Menu, Creating A Second Menu Below The First, Like Multiple Tabs

I have written a java code for a pull out menu. How can I go about creating a second menu, right below the first one, so it looks like multiple tabs.

Here is the code so far...

If someone could re-code this for a second and possible third menu, it would be great.

Cheers


<style type="text/css">
<!--

#master  {position:absolute; width: 200px; top: 10px; left: -120px; z-index:2; visibility:visible;}
#menu   {position:absolute; width: 18px; top: 0px; left: 120px; z-index:5; visibility:visible;}
#top   {position:absolute; width: 120px; top: 0px; left: 0px; z-index:5; visibility:visible;}
#screen  {position:absolute; width: 120px; top: 6px; left: 0px; z-index:5; visibility:visible;}
#screenlinks {position:absolute; width: 120px; top: 6px; left: 0px; z-index:5; visibility:visible;}

-->
</style>
<style type="text/css">
<!--

.NavJump {font-family: arial; font-size: 10pt; color: #808080; text-decoration: none;}
a:link.NavJump {color : #FFD700;}
a:visited.NavJump {color : #FFD700}
a:active.NavJump {text-decoration: none; color: #DAA520;}
a:hover.NavJump {text-decoration: none; color: #DAA520;}

-->
</style>
<script language = "javascript">
<!--

var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ie){
document.write('<style type="text/css">')
document.write("#screen {filter:Alpha(Opacity=120);}")
document.write("</style>")
}

if(ns){
document.write('<style type="text/css">')
document.write("#master {clip:rect(0,150,250,0);}")
document.write("</style>")
}

//-->
</script>
<script language = "javascript">
<!--
 

var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0
 

var master = new Object("element")
master.curLeft = -120; master.curTop = 10;
master.gapLeft = 0;  master.gapTop = 0;
master.timer = null;
 
 

function moveAlong(layerName, paceLeft, paceTop, fromLeft, fromTop){
clearTimeout(eval(layerName).timer)

if(eval(layerName).curLeft != fromLeft){
     if((Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft)) < paceLeft){eval(layerName).curLeft = fromLeft}
else if(eval(layerName).curLeft < fromLeft){eval(layerName).curLeft = eval(layerName).curLeft + paceLeft}
else if(eval(layerName).curLeft > fromLeft){eval(layerName).curLeft = eval(layerName).curLeft - paceLeft}
if(ie){document.all[layerName].style.left = eval(layerName).curLeft}
if(ns){document[layerName].left = eval(layerName).curLeft}
}

if(eval(layerName).curTop != fromTop){
     if((Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop)) < paceTop){eval(layerName).curTop = fromTop}
else if(eval(layerName).curTop < fromTop){eval(layerName).curTop = eval(layerName).curTop + paceTop}
else if(eval(layerName).curTop > fromTop){eval(layerName).curTop = eval(layerName).curTop - paceTop}
if(ie){document.all[layerName].style.top = eval(layerName).curTop}
if(ns){document[layerName].top = eval(layerName).curTop}
}
 

eval(layerName).timer=setTimeout('moveAlong("'+layerName+'",'+paceLeft+','+paceTop+','+fromLeft+','+fromTop+')',30)
}
 

function setPace(layerName, fromLeft, fromTop, motionSpeed){
eval(layerName).gapLeft = (Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft))/motionSpeed
eval(layerName).gapTop = (Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop))/motionSpeed

moveAlong(layerName, eval(layerName).gapLeft, eval(layerName).gapTop, fromLeft, fromTop)
}

var expandState = 0

function expand(){
if(expandState == 0){setPace("master", 0, 10, 10); if(ie){document.menutop.src = "menub.gif"}; expandState = 1;}
else{setPace("master", -120, 10, 10); if(ie){document.menutop.src = "menu.gif"}; expandState = 0;}
}
 
 
 
 
 

//-->
</script>

<div id="master">

<div id="menu">
<table border="0" width="18" cellspacing="0" cellpadding="0">
<tr><td width="100%"><a href="javascript:expand()" onfocus="this.blur()"><img name="menutop" border="0" src="menu.gif" width="18" height="70"></a></td></tr>
</table>
</div>
 

<div id="top">
<table border="0" width="120" cellspacing="0" cellpadding="0">
<tr><td width="100%"><img border="0" src="top.gif" width="120" height="6"></td></tr>
</table>
</div>
 

<div id="screen">
<table border="0" width="120" cellspacing="0" cellpadding="5">
<tr><td width="100%" bgcolor="#B0C4DE">

<table border="0" width="100%" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0">
<tr><td width="100%">

<table border="0" width="100%" cellspacing="1" cellpadding="5">
<tr><td width="100%" bgcolor="#FFFFFF">
 

<font class="NavJump"><br></font><font class="NavJump"><br></font><font class="NavJump"><br></font><font class="NavJump"><br></font><font class="NavJump"><br></font><font class="NavJump"><br></font><font class="NavJump"><br></font>
 

</td></tr>
</table>

</td></tr>
</table>

</td></tr>
</table>
</div>

<div id="screenlinks">
<table border="0" width="120" cellspacing="0" cellpadding="5">
<tr><td width="100%">

<table border="0" width="100%" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0">
<tr><td width="100%">

<table border="0" width="100%" cellspacing="1" cellpadding="5">
<tr><td width="100%" bgcolor="#FFFFFF">

<a href="main.html" class="NavJump" target="B"><b>Home</b></a><br>
<a href="tech.html" class="NavJump" target="B"><b>Technical Help</b></a><br>
<a href="promo.html" class="NavJump" target="B"><b>Promotions</b></a><br>
<a href="brief.html" class="NavJump" target="B"><b>Briefings</b></a><br>
<a href="training.html" class="NavJump" target="B"><b>Training</b></a><br>
<a href="info.html" class="NavJump" target="B"><b>General info</b></a><br>
<a href="http://www.topuptv.com" class="NavJump" target="new"><b>official site</b></a><br>
 

</td></tr>
</table>

</td></tr>
</table>

</td></tr>
</table>
</div>
 
 
 
 

</div>
0
Ryan Bayne
Asked:
Ryan Bayne
1 Solution

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now