Results 1 to 5 of 5

Thread: Tabcontent help pls [ easy task ]

  1. #1
    Join Date
    Jul 2006
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Tabcontent help pls [ easy task ]

    1) Script Title:
    Tab Content Script (v 2.2)
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...tabcontent.htm
    3) Describe problem:

    How to modify tabcontent.js that it will reload the whole page when clicking on the next tab ( from tab 1 to tab 2)?

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

    Default

    Not sure I understand. The whole purpose of Tab Content script is to display different content inline on the page, without reloading or going to a different page altogether. But since you asked, try something like:

    Code:
    <ul id="countrytabs" class="shadetabs">
    <li onClick="location.reload()"><a href="#" rel="country1" class="selected">Tab 1</a></li>
    <li onClick="location.reload()"><a href="#" rel="country2">Tab 2</a></li>
    <li><a href="#" rel="country3">Tab 3</a></li>
    <li><a href="#" rel="country4">Tab 4</a></li>
    <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
    </ul>
    DD Admin

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

    Default

    Thank you, however, it is just reload the page and stay in the same tab.

    How could I do this:

    Tab 1 content --> Click Tab 2--> Reload --> Tab 2 content

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

    Default

    Hmmm try adding a delay before the page reloads. This gives the script ample time to have switched to the new tab:

    Code:
    <ul id="countrytabs" class="shadetabs">
    <li onClick="setTimeout('location.reload()', 500)"><a href="#" rel="country1" class="selected">Tab 1</a></li>
    <li onClick="setTimeout('location.reload()', 500)"><a href="#" rel="country2">Tab 2</a></li>
    <li><a href="#" rel="country3">Tab 3</a></li>
    <li><a href="#" rel="country4">Tab 4</a></li>
    <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
    </ul>
    Make sure that persistence is also enabled when initializing the script on your page.
    DD Admin

  5. The Following User Says Thank You to ddadmin For This Useful Post:

    eroychiu (09-10-2008)

  6. #5
    Join Date
    Jul 2006
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thank you for your reply.

    It load the Tab2 content for a little while, then it reloads and back to content 1.

    Tab 1 content --> Click Tab 2--> Reload --> Tab 2 content

    any other suggestion? I appreciate it

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
  •