+ Start a Discussion
开发商开发商 

Web Tab Scroll Bars

I have a "full page width" web tab with content generated by an HTML Scontrol. When the content exceeds a certain length a vertical scroll bar appears. It appears that the web tab container is where the overflow occurrs.
 
I would like to eliminate the nested scroll bar. How do I do this?
 
The company standard browser is IE.
 
Thanks in advance.
jpizzalajpizzala
Salesforce implements Web Tabs in an iframe of which you can set basic properties for. I don't know of a way to completely "remove" the vertical scroll bar from ever appearing (maybe through some Javascript trickery?) but you can increase the height of the iframe so you don't see it as often.

To do this (if you aren't already familiar), go to Setup -> [App Setup] Build -> Tabs -> "Edit" on desired Web Tab to bring up the wizard. You can change the height on the second page of the wizard ("Content Frame Height (pixels)" field).
Greg HGreg H

I do this all the time with various sControls.  I expect that this code will work as long as you have control over the code of the URL being loaded into the web tab.

The actual function:

Code:
//resizes the frame holding the sControl to make up for odd dimensions
function resizeFrame() {
 var sframe = parent.document.getElementById("itarget"); //get id of iframe from parent
 if (navigator.userAgent.indexOf("Firefox") != -1) { //if Firefox
  var nHeight = document.body.scrollHeight+10; //add ten pixels to height of sControl frame
 } else { //otherwise
  var nHeight = document.body.scrollHeight; //use the returned height of sControl frame
 }
 sframe.style.height = nHeight+"px"; //set the frame height to correspond to the content
}

The trigger for the function:

Code:
resizeFrame(); //calls function from above

Hope this helps,
-greg

MigMig
Sorry to upload this thread but I would like to thank you for your code. It works fine =)