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

Is it possible to have the Elevator Panel Magic system open with a random panel each time the page loads?

The Answer

Prepared Nov. 2008 by Gerry Jacobsen, PVII

Here's a tweak that you can apply to the Elevator Magic system to enable automatic random panel display on page load.

1. Open the p7EPMscripts.js file and Copy and Paste this new script function at the end of the scripts file:

 function P7_EPMrand(r){
   var i,k,j=0,d,dd,tA,a,rD=new Array();
   dd='p7EPMt'+r.replace('p7EPM','');
   d=document.getElementById(dd);
   if(d){
    tA=d.getElementsByTagName("A");
     for(i=0;i<tA.length;i++){
      if(tA[i].p7EPMw){
       rD[j]=tA[i].id;
       j++;
      }
     }
     if(j>0){
       k=Math.floor(Math.random()*j);
       a=document.getElementById(rD[k]);
     }
   }
   return a;
  }

2. Locate these code lines in the P7_initEPM() function, around line 118:

  ob=document.getElementById(tr);>
  if(ob){

3. Add this new line:

  ob=P7_EPMrand(tB.id);

in between the two lines so that it now looks like this:

  ob=document.getElementById(tr);
  ob=P7_EPMrand(tB.id);
  if(ob){

4. Save the file.

That's it! The Elevator Panel will now automatically open to a random panel each time the page loads.

Back to the questions list