Results 1 to 5 of 5

Thread: Help with AJAX Tab Contents Please

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

    Default Help with AJAX Tab Contents Please

    1) Script Title: Ajax Tabs Content script

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

    3) Describe problem:

    I Have a Problem with this AJAX...

    If i do The script like the example on DD, it's work for me. but after i want to add tab inside the tab, the problem come in.

    for example

    i have an index page like the example in DD, This is The index page i want to add an AJAX Tabs.

    | Intro (Active Tab) | Birds |__________
    |This is some default tab content |
    | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
    | bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
    |_____________________________________ |

    and this is external 2.htm which I Want it Like This

    |Intro | Birds (Active Tab) |_____________________
    | | Description (Active Tab) | Type |_____________ |
    | | Birds is A Species That Fly High in The Sky etc etc ||
    | |____________________________________________||
    |_______________________________________________|



    To Sum up, I wAnt The external page to has an AJAX Tab Too... but after i try, The Type Tab (Shown in my picture above) Will Extract The URL, not get the page and view it to the defined div id...

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

    OK, you only need the Ajax tabs script linked to the 'top' page. Now, on your external page, you need to have a different id for the maintab -say, maintab2 and a different id for the content area -say, ajaxcontentarea2. Then on the 'top' page the link that loads the external page should look about like so:

    Code:
    <li><a href="tab2.htm" rel="ajaxcontentarea" onmousedown="window.tab2Init=false;">More Tabs</a></li>
    Then on tab2.htm:

    Code:
    <ul id="maintab2" class="shadetabs" onmouseover="if(!window.tab2Init){startajaxtabs('maintab2');window.tab2Init=true;};">
    <li class="selected"><a href="#default" rel="ajaxcontentarea2">Intro</a></li>
    <li><a href="externa . . .
    You also need to have on tab2.htm a:

    Code:
    <div id="ajaxcontentarea2" class="contentstyle">
    <p>Whatever your default content for these tabs is goes here</p>
    </div>
    - John
    ________________________

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

  3. #3
    Join Date
    Dec 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    window.tab2Init=false;
    what is tab2Init refer to?

    Thx in Advance...

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

    Quote Originally Posted by keren2 View Post
    Code:
    window.tab2Init=false;
    what is tab2Init refer to?

    Thx in Advance...
    It (.tab2Init) is a made up object that is here attached to the window object. It really could be named anything unique to the window object. In this case the object acts like a variable to track whether or not the imported content has been initialized. Imported content of this type must be initialized after each importation but, shouldn't be repeatedly initialized. These two principles cannot both be easily followed with Ajax Tabs but, this method of tracking initialization with a window object cuts down on superfluous initializations while still making sure that each fresh importation gets initialized.
    - John
    ________________________

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

  5. #5
    Join Date
    Dec 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thx...

    Quote Originally Posted by jscheuer1 View Post
    It (.tab2Init) is a made up object that is here attached to the window object. It really could be named anything unique to the window object. In this case the object acts like a variable to track whether or not the imported content has been initialized. Imported content of this type must be initialized after each importation but, shouldn't be repeatedly initialized. These two principles cannot both be easily followed with Ajax Tabs but, this method of tracking initialization with a window object cuts down on superfluous initializations while still making sure that each fresh importation gets initialized.

    Thank You Very much... It's Working now...

    I'll Develop it Futhermore... and maybe if i stuck again, i'll ask you again. thanks for your support ^o^

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
  •