Results 1 to 2 of 2

Thread: Tab Content Script - Linking tabs with text

  1. #1
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face Tab Content Script - Linking tabs with text

    1) Tab Content Script (v 2.2)

    2) http://www.dynamicdrive.com/dynamici...tabcontent.htm

    3) Describe problem:

    Hello

    I am trying to dynamically select a tab content anywhere on my web page, however I have followed the example and its not working Could anyone help me out? Here is what I have:

    Code:
    <li><a href="javascript:aboutsfa.expandit('contact')">Contact Us</a></li>
    
    <div align="center"> 
    <ul id="aboutsfa" class="shadetabs">
    <a href="#" rel="country1" id="venue" class="selected">Our Venue</a> 
    <a href="#" rel="country2" id="contact">Contact Us</a> 
    <a href="#" rel="country3" id="join">Join Us</a> 
    <a href="#" rel="country4" id="question"> Ask a Question</a> 
    <a href="#" rel="country5" id="openshoot">SFA Open Shoots</a> 
    <a href="#" rel="country6" id="getd">Get Directions</a> 
    <a href="http://www.serafinafieldarchers.co.uk/">Example
    The example of how to do this is on the DD URL above, Sorry if it's a simple error


    Thank you for your help

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

    Default

    Your syntax is incorrect. The code to call to dynamically select a tab is:

    Code:
    instance.expandit(tabid_or_position)
    where instance is the variable name you used when initializing that particular tab content instance on the page, for example:

    Code:
    var myflowers=new ddtabcontent("flowertabs") //enter ID of Tab Container
    myflowers.setpersist(true) //toogle persistence of the tabs' state
    myflowers.setselectedClassTarget("link") //"link" or "linkparent"
    myflowers.init(3000)
    DD Admin

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
  •