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

With the Vertical Scroller Magic (VSM) systen is there a way to auotmatically hide the scroller controls if there is not sufficient content to require the controls?

The Answer

Prepared Jan. 2009 by Gerry Jacobsen, PVII

To have the Vertical Scroller Magic (VSM) system conditionally display the control bar based on the rendered height of the scroller contents you can apply this code tweak:

revised 12/02/2009 to handle both Dragbar and Toolbar

1. Open the p7vscscripts.js file and locate this line in the P7_setVSC() function, around line 24:

h+='.p7VSCdragchannel, .p7VSCtoolbar{display: block !important;}\n';

2. Replace that line with this line:

h+='.p7VSCdragchannel, .p7VSCtoolbar{display: block;}\n';

3. Locate this line in the P7_initVSC() function, around line 112:

 

  if(sf){
    sf.style.display="none";
  }
 }

4. Add this code block right after the next to last line:

 

  dB=document.getElementById(tB.id.replace("b","cn"));
  dD=document.getElementById(tB.id.replace("b","tb"));
  if(sD.offsetHeight<=tB.p7opt[6]){
     if(dB){dB.style.display='none';}
     if(dD){dD.style.display='none';}
     tB.style.height=sD.offsetHeight+'px';
  }else{
     if(dD){dD.style.display='block';}
     if(dB){dB.style.display='block';}
  }

so that it now looks like this:

 

  if(sf){
    sf.style.display="none";
  }
  dB=document.getElementById(tB.id.replace("b","cn"));
  dD=document.getElementById(tB.id.replace("b","tb"));
   if(sD.offsetHeight<=tB.p7opt[6]){
     if(dB){dB.style.display='none';}
     if(dD){dD.style.display='none';}
     tB.style.height=sD.offsetHeight+'px';
  }else{
     if(dD){dD.style.display='block';}
     if(dB){dB.style.display='block';}
  }
 }

5. Save the file.

That's it. The system will now only control bar if the rendered contents have sufficient height to warrant the scroller.

Back to the questions list