Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript menu must remain open

Status
Not open for further replies.

forces1

Programmer
Apr 5, 2007
29
NL
Hi, I have a little script on my site that runs a dropdown menu. Works great, but it runs on every page and on every page the menu starts with its original position, so with nothing dropped down. Can't I make it that the dropdown from the last page remains dropped down? This is the script:

Code:
<script type="text/javascript">
<!--
var ver='4.0.3';
var n03=0;
var dynPref='menu';
var n04 = 0 ;
document.n05 = 1;
var imf = "." ;
var imf0 = imf+"/menui0.gif";
var imf1 = imf+"/menui1.gif";
var imf2 = imf+"/menui2.gif";
var imf3 = imf+"/menui3.gif";
var syncEl = null;
var singleFolder = false;
var autoSync = 0;
var syncBgColor='White';
var syncTxColor='#000095';
function doAutoSync(){if(autoSync==2)setTimeout("doAutoSync()",2000);if(autoSync)synchronize(document.location);}
var n02 = false ;
var nDays = 0 ;
document.write("<"+"script language='JavaScript1.2' src='./tree_dom.js'><"+"/"+"script>");
document.write("<"+"style type='text/css'>");
document.write (".SXLP0:hover {text-decoration:underline;}");
document.write (".SXLR:hover {text-decoration:underline}");
document.write (".SXLR,.SXR {color:#00008A; font-weight:bold; font-family:Arial; font-size:14px; }");
document.write (".SXLP0,.SXLR {text-decoration:none}");document.write (".SXP0,.SXLP0 {color:#00008A; font-weight:bold; font-family:Arial; font-size:14px; }");
document.write (".SXLC0,.SXC0 {color:#80FF00; font-family:Arial; font-size:11px; }");
document.write (".SXLP1,.SXLC0 {text-decoration:none}");document.write (".SXP1,.SXLP1 {color:#80FF00; font-family:Arial; font-size:11px; }");
document.write (".tbl {width:'100%'}");
document.write (".im{margin-left:4px}");
document.write (".SXP0{padding:2px;margin-bottom:1px;background-color:White;text-align:left;}");
document.write (".SXR{padding:2px;margin-bottom:1px;background-color:White;text-align:left;;}");
document.write (".SXP1{padding:2px;margin-bottom:1px;background-color:#B2CFEB;text-align:left;padding-left:7px;display:none}");
document.write (".SXC0{padding:2px;margin-bottom:1px;background-color:#B2CFEB;text-align:left;padding-left:7px;;display:none}");
document.write("</"+"style>");

//-->
</script>
<table id="m1mainSXMenu2" cellspacing="0" cellpadding="0"  style=";width:">
<tr><td><div id="SXR" onmouseover="itemHL(this,'White','#000095')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXR">
Home
</div>

<div id="I0SXE6SXP"  onmouseover="itemHL(this,'White','#000095')" onmouseout="itemHL(this)" onclick="p06(null,0,6)"  style="background-color:#FFFFFF;" class="SXP0">
 Algemene informatie
</div>

<div id="I0SXE6SXC" onmouseover="itemHL(this,'#003366','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="SXLC0" id="I0SXE6SXCA" href="#" >Het gezicht achter</a>
</div>

<div id="I0SXE8SXC" onmouseover="itemHL(this,'#006ab3','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="link1" id="I0SXE8SXCA" href="lestijden.html" target="content">Lestijden en locatie</a>
</div>

<div id="I0SXE9SXC" onmouseover="itemHL(this,'#003366','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="SXLC0" id="I0SXE9SXCA" href="#" target="content">Contactgegevens</a>
</div>

<div id="I0SXE10SXP"  onmouseover="itemHL(this,'White','#000095')" onmouseout="itemHL(this)" onclick="p06(null,0,10)"  style="background-color:#FFFFFF;" class="SXP0">
 Sportstimulering
</div>

<div id="I0SXE10SXC" onmouseover="itemHL(this,'#003366','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="SXLC0" id="I0SXE10SXCA" href="#" >Aangepaste sportlessen scholen</a>
</div>

<div id="I0SXE12SXC" onmouseover="itemHL(this,'#003366','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="SXLC0" id="I0SXE12SXCA" href="#" >Naschoolse opvang</a>
</div>

<div id="I0SXE13SXC" onmouseover="itemHL(this,'#003366','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="SXLC0" id="I0SXE13SXCA" href="#" >Sportkampen</a>
</div>

<div id="I0SXE14SXP"  onmouseover="itemHL(this,'White','#000095')" onmouseout="itemHL(this)" onclick="p06(null,0,14)"  style="background-color:#FFFFFF;" class="SXP0">
 Sportactiviteiten
</div>

<div id="I0SXE14SXC" onmouseover="itemHL(this,'#003366','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="SXLC0" id="I0SXE14SXCA" href="#" >Judo</a>
</div>

<div id="I0SXE16SXC" onmouseover="itemHL(this,'#003366','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="SXLC0" id="I0SXE16SXCA" href="#" >Conditietraining</a>
</div>

<div id="I0SXE17SXC" onmouseover="itemHL(this,'#003366','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="SXLC0" id="I0SXE17SXCA" href="#" >Zelfverdediging</a>
</div>

<div id="I0SXE18SXC" onmouseover="itemHL(this,'#003366','White')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXC0">
<a class="SXLC0" id="I0SXE18SXCA" href="#" >Valtraining</a>
</div>

<div id="SXR19" onmouseover="itemHL(this,'White','#000095')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXR">
Agenda
</div>

<div id="SXR20" onmouseover="itemHL(this,'White','#000095')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXR">
Gastenboek
</div>

<div id="SXR21" onmouseover="itemHL(this,'White','#000095')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXR">
Foto's
</div>

<div id="SXR22" onmouseover="itemHL(this,'White','#000095')" onmouseout="itemHL(this)" style="background-color:#FFFFFF;"  class="SXR">
Links
</div>

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

Thanks a lot.
 
What have you tried yourself? We're happy to help you to help yourself, but this is not a free javascript help site.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
I've tried to only change the text and leave the menu remained, but that didn't work. I've also tried to fix it in the javascript-code, I think it has something to do with the variable autoSync, but I'm not sure.
 
I think we would need more information to even try help. Wheres your itemHL and p06 functions? What is treedom.js? Why are you using document.write to write out css? You can maybe achieve what you are trying to accomplish parsing the url of your site and passing a parameter to whatever function your opens your menu.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top