Results 1 to 3 of 3

Thread: How to hide tab (Tab Content Script)

  1. #1
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to hide tab (Tab Content Script)

    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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    document.getElementById('someId').style.visibility='hidden'
    and to reveal:

    Code:
    document.getElementById('someId').style.visibility='visible'
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •