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 #272

With Pop Menu Magic 2 (PMM2) is there a way to have the sub menu that corresponds to the current page be always open and visible (persistent)?

The Answer

Prepared Oct. 2009 by Gerry Jacobsen, PVII

You can apply a simple code tweak for the Pop Menu Magic 2 (PMM2) system that will set the sub menu that corresponds with the "Current Marked" link to open automatically when the page first loads, and stay open (persistent) when the menu is not being used. When there is user action on the menu the sub will hide and allow normal menu mouse over action. When the user mouses away form the menu the "persistent" sub menu will be made visible again and stay visible while the menu is at rest.

See how this tweak works on this simple example page.

To apply the tweak:

1. Open the p7PMMscripts.js file, scroll to the end of the file and a new line and then paste this new function into that new line:

function P7_PMMpersist(d){
  var a,tB;
  a=document.getElementById(d)
  if(a&&a.pmmsub){
  tB=document.getElementById(a.pmmsub);
  tB.p7persist=true;
  P7_PMMtrig(a);
  }
}

2. Locate this block of code in the P7_PMMshut(d) function, around line 306:

   if(tD[k].p7state&&tD[k].p7state=='open'){
     P7_PMMclose(tD[k]);
   }
 }

4. Make a new line right after the third line (the first }) and paste this code into the new line:

   if(tD[k].p7persist){
      var a=document.getElementById(tD[k].p7trigger);
      P7_PMMtrig(a);
   }

so that it now looks like this:

   if(tD[k].p7state&&tD[k].p7state=='open'){
     P7_PMMclose(tD[k]);
   }   
   if(tD[k].p7persist){
     var a=document.getElementById(tD[k].p7trigger);
     P7_PMMtrig(a);
   }
 }

5. Now, to modify the current marker to set the sub(s) to persistent, locate this code block in the P7_PMMcurrentMark(el) function, around line 690:

 

      im.src=im.p7imgswap[3];
    }
   }
  }
  else{

6. Make a new line right after the second line (the first }) and paste this code into the new line:

    if(a[0].pmmsub){P7_PMMpersist(a[0].id);}

so that it now looks like this:

      im.src=im.p7imgswap[3];
    }
    if(a[0].pmmsub){P7_PMMpersist(a[0].id);}
   }
  }
  else{

7. Save and close the file.

That's it! The sub menu(s) correlating to the current marked link will now show automatically and stay open (persistent) when the menu is at rest.

Back to the questions list