PDA

View Full Version : Help with AJAX Tab Contents Please



keren2
02-11-2007, 05:55 AM
1) Script Title: Ajax Tabs Content script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/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...

jscheuer1
02-11-2007, 10:51 AM
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:


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

Then on tab2.htm:


<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:


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

keren2
02-12-2007, 09:36 AM
window.tab2Init=false;

what is tab2Init refer to?

Thx in Advance...

jscheuer1
02-12-2007, 03:41 PM
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.

keren2
02-13-2007, 12:52 PM
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^