Results 1 to 4 of 4

Thread: Tab Content Script - open tab with a link on the same page

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

    Default Tab Content Script - open tab with a link on the same page

    I am using this script: http://www.dynamicdrive.com/dynamici...tabcontent.htm

    I have a link inside the content of 1st tab - "view more samples" - that should open the 3rd tab called "Samples". I got it to open the third tab on that same page, but the 3rd tab doesn't get highlighted properly.

    I am using this code for the link:

    <a href="" onClick="return expandcontent('sc3', this)">view more samples</a>

    You can see the page here:

    http://www.digitaltutors.com/store/p...&cat=51&page=1

    Does anyone have an idea how I can get the "Samples" tab to highlight?

    thanks!

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

    Default

    Firstly, per our usage terms, please note that the credit notice for this script should be in your actual page source. In other words, the notice:
    Code:
    /***********************************************
    * Tab Content script- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    should be in between the <script> tags for this script and not inside the .js file itself.

    To answer your question, one way is to do the following:

    First, identify the tab that you want to jump to from within the same page, and give it an ID attribute:

    Code:
    <li><a href="new.htm" onClick="return expandcontent('sc2', this)" theme="#EAEAFF" id="whatsnew" >What's New</a></li>
    Here I'm saying the 2nd tab in the demo is the one I want to jump to.

    Then, for the jump to link, do something like this:

    Code:
    <a href="new.htm" onClick="return expandcontent('sc2', document.getElementById('whatsnew'))" theme="#EAEAFF">What's New</a>
    Clicking on the above link should now jump to the 2nd tab while highlighting it as well.

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

    Default

    Thank you for the reply. I apologize for not following your usage terms, I guess I never came across them. I will fix that.

  4. #4
    Join Date
    Jun 2005
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    It appears to me that this hint was written for the old version of the tab content script. Could you update it to support the new version?

    The page in question is where I am trying to apply it is:

    http://www.flyingscool.com/Downloads.htm

    I'm totally lost.

    Thanks,

    Thomas

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
  •