Results 1 to 8 of 8

Thread: Regarding "Tab Content Script"

  1. #1
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Regarding "Tab Content Script"

    I was using the "Tab Content Script" found on DD site. This is the address http://www.dynamicdrive.com/dynamici...tabcontent.htm
    I noticed that the links on the tabs don't go anywhere. When clicking, all they do is change the contend of the window below the tabs. My question is, how do I make the link active? Other than that, it's a great script.

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

    Default

    That's by design, as the tab content are revealed by clicking on each tab. If the tabs also went to a URL, the tab content would never be shown as the user is taken to another page.

  3. #3
    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

    Well, ddadmin, of course is correct but, if you want to modify it to say, reveal the content onmouseover, there is no reason not to allow the links to be active, and they will be if you just change 'onClick=' to 'onmouseover='. Also, if viewed by a non javascript enabled browser, the links will be active.
    - John
    ________________________

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

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

    Default

    Thank you all for you help and info. My question is, can I have both so that when I click the tab, it changes the tab content and the page, which will then be on the current tab. In other words, I will make a new page for each tab and when clicked on the tab, the tab content would change, along with the page. Is this possible? Any recommendations?

    Thanks Again

  5. #5
    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

    Use the optional persistence code. For what you are talking about, set it to sitewide and also remove 'return' from the onClick events, changing (from the demo):
    Code:
    <a href="new.htm" onClick="return expandcontent('sc2', this)" theme="#EAEAFF">What's New</a>
    to this:
    Code:
    <a href="new.htm" onClick="expandcontent('sc2', this)" theme="#EAEAFF">What's New</a>
    - John
    ________________________

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

  6. #6
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John. What you recommended worked. The only thing now is that after the first time I use the tab, the next time I click on it, it won't change the page. Its as if it only allows itself to be used once. After the initial use of the tab, the page remains the same, but the tab content continues to work properly. What do you suppose I do know?
    Thanks again.

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

    Default

    Did you remember to remove "return" from the onClick code across all pages that use this script?

  8. #8
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That did the trick! Thank you! I just discovered this site and its awesome.

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
  •