PDA

View Full Version : How to hide tab (Tab Content Script)



bper
01-24-2006, 09:24 PM
Hi,

The script works well. But there is something that I need to do.

I'd like to be able to determine dynamically whether or not to display a tab. For example if a certain condition exists, I want to hide the tab.

If 3 tabs exist, I can hide the third tab without a problem with 'if' logic. But if only two tabs exist, with the same logic the page will not be displayed. It seems as if there must be at least two tabs for this to work.

Is there a way to 'hide' a tab if necessary?

Thanks.

jscheuer1
01-24-2006, 10:55 PM
The simplest way to hide something and still have the page display as it otherwise normally would is to set the visibility property of the element you want hidden. Is this what you did to hide tabs 3 and 2? If not, give it a shot -


to hide:


document.getElementById('someId').style.visibility='hidden'

and to reveal:


document.getElementById('someId').style.visibility='visible'

bper
01-26-2006, 03:38 PM
Thanks for responding.

No, that's not how I attempted to do it, but your suggestion is good and it works. Problem solved.

Thanks a lot.