Results 1 to 6 of 6

Thread: tab content - 6 on 1 page, switch tabs all at once?

  1. #1
    Join Date
    Feb 2005
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default tab content - 6 on 1 page, switch tabs all at once?

    1) Script Title: Tab Content Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tabcontent.htm

    3) Describe problem: hi guys, i have put six of these on one page, and i was wondering if its possible to make it so if i select tab 2 on the first tab script, all 4 scripts change to tab2?

    its a great script as is, and this is just me thinking of the 'look' of my page, could look much nice if i could do this. you might get a better idea if you see what i'm doing here : www. selfcctv .co.uk

    any idea?

    thanks
    james

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmmm no easy way that I can think of unfortunately. Each tab content instance is pretty much independent from the next. You can manually call:

    Code:
    expandtab(tabcontentid, tabnumber)
    to have mutiple tabs selected when a link is clicked on, for example, but that's not what you're asking.

  3. #3
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm actually trying to do what you are referring to. Where would I put this code and how would I call it manually? Am I going to be using an OnClick script function?

    Just stumbled upon this great script and am working with it now, appreciate any help.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    HI mkchronos:
    Usage of expandtab() is actually explained on the script page. For example:

    For example, to create a link that selects the 3rd tab of the Tab Content with UL id="maintab", you could use this code:
    Code:
    <a href="javascript: expandtab('maintab', 2)">Select 3rd tab of "maintab"</a>
    As you can see, the tab count starts at 0, so 2 references the 3rd tab.

  5. #5
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Much appreciated, that was my problem. I was trying to use numeric representation instead of the names. Guess I should have read closer.

  6. #6
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Actually, as I read back through this post, this is more of what I ended up doing later on. In order to bypass the limit of the anchor tags, I ended up creating <img> tags for my label names, then attached the code for the onClick inside of them. That allowed me to force the tab of one sheet to open another.

    Code:
    <li class="selected"><a href="#" rel="detail1">
    <img onClick="javascript: expandtab('charttab', 1)" src="/images/school_legend.png"/>">
    </a></li>
    Thus clicking on this detail1 link, would also open the second tab on the chart tabs.

    Hope this helps.

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
  •