Scroll To Top

Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

PVII Knowledge Base

1. Select a product ...
2. Select category ...
3. Search the Knowledge Base...

Question #182

In Tab Bar Magic, my root links represent the main pages in a section. I also have the main pages linked in my sub-menus. I would like both the sub-menu link and the root link to highlight when that page is visited.

The Answer

Prepared Apr. 2006 by Al Sparber, PVII

Open your Tab Bar Magic menu script file ( p7tbmenu.js), which is located in p7tbm folder. Locate the function P7_TBMopen and replace it with the revised function listed below.

function P7_TBMopen(){ //v1.0.2 by PVII-www.projectseven.com
var x,i,j,k,kk,wH,tM,tA,pp,cl,a,nd,op,r1,aU;wH=window.location.href;
var mt = new Array(1,'','');if(document.p7TBMop){mt=document.p7TBMop;}op=mt[0];
if(op<1){return;}r1=/index\.[\S]*/i;k=-1,kk=-1;tM=document.getElementById('p7TBM');
tA=tM.getElementsByTagName("A");for(j=0;j<tA.length;j++){aU=tA[j].href.replace(r1,'');
if(op>0){if(tA[j].href==wH||aU==wH){k=j;kk=-1;
// tweak to allow last link found
//break;
//end tweak
}}if(op==2){if(tA[j].firstChild){
if(tA[j].firstChild.nodeValue==mt[1]){kk=j;}}}if(op==3 && tA[j].href.indexOf(mt[1])>-1){
kk=j;}if(op==4){for(x=1;x<mt.length;x+=2){if(wH.indexOf(mt[x])>-1){
if(tA[j].firstChild&&tA[j].firstChild.nodeValue){if(tA[j].firstChild.nodeValue==mt[x+1]){
kk=j;}}}}}}k=(kk>k)?kk:k;if(k>-1){a=false;if(!tA[k].hasIm&&!tA[k].isRoot){cl=tA[k].className;
tA[k].className=(cl&&cl.length>0)?cl+" p7TBMmark":"p7TBMmark";}pp=tA[k].parentNode;
while(pp){if(pp.id&&pp.id=='p7TBMroot'){a=tA[k];break;}if(pp.id&&pp.id.indexOf('p7TBMsub')>-1){
nd='p7TBMt'+pp.id.replace('p7TBMsub','');a=document.getElementById(nd);break;} pp=pp.parentNode;}if(a){P7_TBMdown(a);}} }

Back to the questions list