Results 1 to 4 of 4

Thread: Tab Content Script

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

    Default Tab Content Script

    1) Script Title: Tab Content Script

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

    3) Describe problem:
    I was trying to use it at www.delhievents.com ( added the code inside blogger widget which i'm using )
    But the href="#" in the code below tries to open the page at my site instead of opening the tab.

    <li><a href="#" rel="tcontent2">Tab 2</a></li>

    What can be done about it?

    Regards, Rohit

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

    Default

    Are you trying to add a link inside one of the Tabbed contents that selects a particular tab when clicked on? If so this is also documented in the DD script page:

    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.

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

    Default

    No, i was just trying to click on tab to load it's content. You can check the modified code below :



    <ul id="maintab" class="shadetabs">
    <li class="selected"><a href="javascript: expandtab('maintab', 0)">Tab 1</a></li>

    <li><a href="javascript: expandtab('maintab', 1)">Tab 2</a></li>



    </ul>

    <div class="tabcontentstyle">

    <div id="maintab" class="tabcontent">

    Tab 1 content here

    </div>


    <div class="tabcontentstyle">

    <div id="maintab" class="tabcontent">

    Tab 2 content here

    </div>

    <script type="text/javascript"><br/>//Start Tab Content script for UL with id="maintab"

    Separate multiple ids each with a comma.<br/>initializetabcontent("maintab")<br/></script>

    content here

    </div>

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

    Default

    And here is the old code which tries to open a url instead of tabs :
    ( when i click on a tab, it tries to open http://www.mydomain.com/# instead of the tab )

    <ul id="maintab" class="shadetabs">
    <li class="selected"><a href="#" rel="tcontent1">Tab 1</a></li>

    <li><a href="#" rel="tcontent2">Tab 2</a></li>

    </ul>


    <div class="tabcontentstyle">

    <div id="tcontent1" class="tabcontent">

    Tab 1 content here
    </div>


    <div class="tabcontentstyle">

    <div id="tcontent2" class="tabcontent">

    Tab 2 content here

    </div>
    </div>

    <script type="text/javascript"><br/>//Start Tab Content script for UL with id="maintab"

    Separate multiple ids each with a comma.<br/>initializetabcontent("maintab")<br/></script>

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
  •