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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

menu tree nav nar

Status
Not open for further replies.

devondago

Programmer
Jan 22, 2003
38
US
I have a nav menu tree that works like this. there are 5 buttons each button represents a set of topics. When you click on one of those five buttons each display a set of submenu buttons. Each button expands horizontally to display the sub button. My issue is that I would like the submenu to remain open for that particular menu of sub buttons when the user click on the desire page. What is happening now is that when you open the submenu by clicking and you go ahead and click on one of the submenus it closes the menu but the page displays. I would like the the menu to remain open while moving to the new page. I am coding my buttons like this...
example
<!-- Community -->
<div id=&quot;Commmenu&quot; style=&quot;position:absolute; left:2px; top:552px; width:155; z-index:129; height: 25; visibility: visible&quot;><a href=&quot;javascript:;(' onClick=&quot;TEST_trigMenu1('Commmenu',1);return false&quot; onMouseOver=&quot;TEST_rollCMenu1(event,'Commmenu',0)&quot; onMouseOut=&quot;TEST_rollCMenu1(event,'Commmenu',0)&quot; onFocus=&quot;if(this.blur)this.blur()&quot;><img src=&quot;images/comm_btn.gif&quot; width=&quot;155&quot; height=&quot;25&quot; name=&quot;Commbut&quot; border=&quot;0&quot; alt=&quot;Community&quot;></a></div>

On my body tags I attached a script that has been used in the pass in our site.
Since I cant point the error I could sure use your help.
here is the scrript i am using....
<script language=&quot;JavaScript&quot;>

<!--
function MM_reloadPage(init) { //Designed
if (init==true) with (navigator) {if ((appName==&quot;Netscape&quot;)&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function TEST_rollCMenu1(ev,a,b) { //
var e,im,ts,j,nu,g,tev=ev.type;
if(!document.TESTmc)return;
if(tev==&quot;mouseover&quot;){for(var x=0;x<TESTm.length;x++){
if(TESTm[x]==a){g=TESTm2[x];if(parseInt(b)==0 && g.TESTopen) {break;return;}
e=MM_findObj(TESTm1[x].TESTimname);im=e.src;ts=im.replace(&quot;_open&quot;,&quot;&quot;);
ts=ts.replace(&quot;_over&quot;,&quot;&quot;);j=ts.lastIndexOf(&quot;.&quot;);
e.src=ts.substring(0,j)+&quot;_over&quot;+ts.substring(j,ts.length);break;}}
}else if(tev==&quot;mouseout&quot;){for(var x=0;x<TESTm.length;x++){
if(TESTm[x]==a){e=MM_findObj(d=TESTm1[x].TESTimname);im=e.src;
g=TESTm2[x];ts=im.replace(&quot;_open&quot;,&quot;&quot;);ts=ts.replace(&quot;_over&quot;,&quot;&quot;);
if(g.TESTopen){j=ts.lastIndexOf(&quot;.&quot;);
nu=ts.substring(0,j)+&quot;_open&quot;+ts.substring(j,ts.length);
}else{nu=ts;}e.src=nu;break;}}}
}

function TEST_getHW(t,a) { //
var r,p,h=0,w=0;if((p=MM_findObj(a)) !=null){
if(document.all || document.getElementById){h=parseInt(p.offsetHeight);w=parseInt(p.offsetWidth);
if(!h){h=parseInt(p.style.pixelHeight);w=parseInt(p.style.pixelWidth);}
}else if(document.layers){h=parseInt(p.clip.height);w=parseInt(p.clip.width);}}
if(t==&quot;width&quot;){r=w;}else{r=h;}return r;
}

function TEST_MM1dwt() { //
var g,lh,sw,fr = false;
if(!document.TESTmc)return;
for(var x=0;x<TESTm1.length;x++){tl=TESTm1[x].id;lh=&quot;TESTCM1DWT0&quot;+tl;
if((g=MM_findObj(lh)) !=null){fr=true;sw=0;break;}
lh=&quot;TESTCM1DWT1&quot;+tl;if((g=MM_findObj(lh)) !=null){fr=true;sw=1;break;}}
if(fr){eval(&quot;TEST_trigMenu1('&quot;+tl+&quot;',&quot;+sw+&quot;)&quot;);}
}

function TEST_setMenu1() { //
var s,d,g,g2,gg,ww,kx,th,tu,ts,nu,xx,k=0,pa=0;args=TEST_setMenu1.arguments;
if((navigator.appName==&quot;Netscape&quot;) && parseInt(navigator.appVersion)>4 && navigator.userAgent.indexOf(&quot;Opera&quot;)==-1){pa=&quot;px&quot;;}
if(navigator.userAgent.indexOf(&quot;Opera&quot;)>-1){TESTOperaW=window.innerWidth;TESTOperaH=window.innerHeight;}
if(!document.TESTmc) {
TESTm=new Array();document.TESTmc=true;TESTms=new Array();document.TEST_imswap=new Array();document.TEST_imswapo=new Array();
TESTm1=new Array();TESTm2=new Array();TESTmprop=new Object();TESTmprop.TESToffset=args[0];TESTmprop.TESTrate=args[1];
TESTmprop.TESTdelay=args[2];TESTmprop.TESTbottom=args[3];
if(document.layers){TESTmprop.TESTpageh = document.height;}}
for(var x=4;x<args.length;x+=3){if((g=MM_findObj(args[x])) !=null){
TESTm[k]=args[x];g.TESTimname=args[x+2];g.TESTsub=args[x+1];
g2=MM_findObj(args[x+2]);tu=g2.src;ts=tu.lastIndexOf(&quot;.&quot;);
nu=tu.substring(0,ts)+&quot;_open&quot;+tu.substring(ts,tu.length);
nu2=tu.substring(0,ts)+&quot;_over&quot;+tu.substring(ts,tu.length);
document.TEST_imswap[k]=new Image();document.TEST_imswap[k].src=nu;
document.TEST_imswapo[k]=new Image();document.TEST_imswapo[k].src=nu2;k++;}}
var lf=0;for (var j=0;j<TESTm.length;j++){
if((g=MM_findObj(TESTm[j])) !=null){d=(document.layers)?g:g.style;TESTm1[j]=g;g.TESTwaiting=false;
if(j==0){lf=parseInt(d.left);th=parseInt(d.top);}
if(j>0){d.left=(lf+pa);th+=TEST_getHW('height',TESTm[j-1]);d.top=(th+pa);}
if((s=MM_findObj(g.TESTsub)) !=null){TESTm2[j]=s;ww=TEST_getHW('width',g.TESTsub);
kx=lf-ww-20;dd=(document.layers)?s:s.style;
dd.left=(kx+pa);dd.top=(th+pa);TESTms[j]=th;dd.visibility=&quot;visible&quot;;s.TESTopen=false;s.TESTwaiting=false;}}}
if((g=MM_findObj(TESTmprop.TESTbottom)) !=null){d=(document.layers)?g:g.style;
d.left=(lf+parseInt(args[0])+pa);th+=TEST_getHW('height',TESTm[TESTm.length-1]);d.top=(th+pa);}
}

function TEST_wait(a) { //
var ma,mb;if((mb=MM_findObj(a)) !=null){
if(!mb.TESTwaiting || mb.TESTwaiting==&quot;none&quot;){return;}
ma=mb.TESTwaiting;mb.TESTwaiting=false;eval(ma);}
}

function TEST_trigMenu1(a,sw) { //
var x,g,gg,d,dd,w,lp,tp,im,im2,ts,nu,e,pa=0;
if(!document.TESTmc)return;
if((navigator.appName==&quot;Netscape&quot;) && parseInt(navigator.appVersion)>4 && navigator.userAgent.indexOf(&quot;Opera&quot;)==-1){pa=&quot;px&quot;;}
if(navigator.userAgent.indexOf(&quot;Opera&quot;)>-1){if( TESTOperaW!=window.innerWidth || TESTOperaH!=window.innerHeight)TEST_setMenu1();}
var ofs=parseInt(TESTmprop.TESToffset),trt = parseInt(TESTmprop.TESTrate);
var tdy=parseInt(TESTmprop.TESTdelay),tsb,tlf,tst;
for(x=0;x<TESTm.length;x++){if(TESTm[x]==a){
d=TESTm1[x];dd=(document.layers)?d:d.style;g=TESTm2[x];gg=(document.layers)?g:g.style;
e=MM_findObj(d.TESTimname);im=e.src;ts=im.replace(&quot;_open&quot;,&quot;&quot;);ts=ts.replace(&quot;_over&quot;,&quot;&quot;);
if(!g.TESTopen){tst=&quot;closed&quot;;im2=ts.lastIndexOf(&quot;.&quot;);
nu=ts.substring(0,im2)+&quot;_open&quot;+ts.substring(im2,ts.length);ts = nu;
}else{tst=&quot;open&quot;}break;}}
for(j=0;j<TESTm.length;j++){
d=TESTm1[j];dd=(document.layers)?d:d.style;g=TESTm2[j];gg=(document.layers)?g:g.style;
if(j==0){tlf=parseInt(dd.left);}
if(g.TESTopen){w=TEST_getHW('width',d.TESTsub)+20;w-=parseInt(dd.left);w*=-1;d.TESTwaiting=false;
eval(&quot;TEST_BM1('&quot;+d.TESTsub+&quot;',&quot;+w+&quot;,&quot;+parseInt(gg.top)+&quot;,&quot;+trt+&quot;,&quot;+tdy+&quot;,0,0)&quot;);}
d.TESTwaiting=false;g.TESTopen=false;
if(parseInt(sw)==1){e=MM_findObj(d.TESTimname);im=e.src;im2=im.replace(&quot;_open&quot;,&quot;&quot;);e.src=im2;}}
var tnt=new Array();var df=0,tcd=0,tdl=TESTm[0];
for(j=0;j<TESTm.length;j++){
d=TESTm1[j];dd=(document.layers)?d:d.style;g=TESTm2[j];gg=(document.layers)?g:g.style;
if(j==0){th=parseInt(dd.top);}tnt[j]=th;df=Math.abs(parseInt(dd.top)-th);
if(df>tcd){tdl=TESTm[j];tcd=df;}th+=TEST_getHW('height',TESTm[j]);
if(x==j && tst==&quot;closed&quot;){tsb=th;th+=TEST_getHW('height',d.TESTsub);}TESTms[j]=th;}
if(tst==&quot;closed&quot;) {d=TESTm1[x];dd=(document.layers)?d:d.style;
g=TESTm2[x];gg=(document.layers)?g:g.style;lp=tlf+ofs;
gg.top=(tsb+pa);TESTms[x]=tsb;gg.visibility=&quot;visible&quot;;e=MM_findObj(d.TESTimname);
if(parseInt(sw)==1){e.src=ts;}var r;g.TESTopen=true;r=MM_findObj(tdl);
r.TESTwaiting=&quot;TEST_BM1('&quot;+d.TESTsub+&quot;',&quot;+lp+&quot;,&quot;+tsb+&quot;,&quot;+trt+&quot;,&quot;+tdy+&quot;,0,0)&quot; ;
}else{d=TESTm1[TESTm1.length-1];d.TESTwaiting=&quot;none&quot;;}
for(j=0;j<TESTm.length;j++ ){eval(&quot;TEST_BM1('&quot;+TESTm[j]+&quot;',&quot;+tlf+&quot;,&quot;+tnt[j]+&quot;,&quot;+trt+&quot;,&quot;+tdy+&quot;,0,0)&quot;);}
if((g=MM_findObj(TESTmprop.TESTbottom)) !=null){d=(document.layers)?g:g.style;g.TESTwaiting=false;
eval(&quot;TEST_BM1('&quot;+TESTmprop.TESTbottom+&quot;',&quot;+(tlf+ofs)+&quot;,&quot;+th+&quot;,&quot;+trt+&quot;,&quot;+tdy+&quot;,0,0)&quot;);
th+=(document.layers)?TEST_getHW('height',TESTmprop.TESTbottom):0;}
if(document.layers){var tw2=document.width;
if(document.height<th) {document.height=th;document.width=tw2;}}
}

function TEST_BM1(el,x,y,a,b,c,s) { //
var g,elo=el,f=&quot;&quot;,m=false,d=&quot;&quot;;x=parseInt(x);y=parseInt(y);
var t = 'g.TESTBM = setTimeout(&quot;TEST_BM1(\''+elo+'\',';
if ((g=MM_findObj(el))!=null) {d=(document.layers)?g:g.style;}else{return;}
var xx=(parseInt(d.left))?parseInt(d.left):0;
var yy=(parseInt(d.top))?parseInt(d.top):0;
var i=parseInt(a);
if (eval(g.moved)){clearTimeout(g.TESTBM);}
if (xx<x){xx+=i;m=true;if(xx>x){xx=x;}}
if (xx>x){xx-=i;m=true;if(xx<x){xx=x;}}
if (yy<y){yy+=i;m=true;if(yy>y){yy=y;}}
if (yy>y){yy-=i;m=true;if(yy<y){yy=y;}}
if (m) {if((navigator.appName==&quot;Netscape&quot;) && parseInt(navigator.appVersion)>4 && navigator.userAgent.indexOf(&quot;Opera&quot;)==-1){
xx+=&quot;px&quot;;yy+=&quot;px&quot;;}
d.left=xx;d.top=yy;g.moved=true;eval(t+x+','+y+','+a+','+b+','+c+',0)&quot;,'+b+')');
}else {g.moved=false;TEST_wait(elo);}
}
//-->
</script>

Thanks for taking the time to help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top