View Full Version : Ajax Tabs Content Script (v 2.2)

why not
01-20-2011, 11:04 PM
DD ajax tabs script :

I import this scritp to my php code! this nice and perfectly but i have any problem with chached tabs .
my php page cached in any folder ( /cache) for reduce speed . now my php code check if in php page ( example index.php ) any change defualt ! regenerate new php static page for cache. now if user check tab 2 or etc php cache regenerate new php static page. how to fix this ?? always defualt tabs1 or etc..

Thanks for ANy help.

01-21-2011, 06:58 AM
I'm not sure I understand fully- are you asking how to disable the bust cache feature of the script? By default the script adds a random number to each tab's Ajax request, to stop browser caching of the corresponding page. If you wish to disable that feature, inside the .js file, remove the part in red below:

page_request.open('GET', ajaxfriendlyurl+bustcacheparameter, true)

why not
01-21-2011, 09:30 AM
You check this address :


so click tab2 . DD tabs load any external page. so now refresh browser ( i checked using IE ) after refresh DD tab show Tab2 defualt . this false ! tab1 is defualt .


01-21-2011, 11:42 AM
As far as the script goes, that's not a cache. It's a javascript cookie that 'remembers' which tab was selected. To disable that part, set the persist to false, ex:

<script type="text/javascript">

var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
countries.setselectedClassTarget("link") //"link" or "linkparent"


why not
01-23-2011, 08:31 AM
found new problem ! i test with php external gallery images and colorbox lightbox! so load external page not worked.


Now i when images in default page tabs, colorbox lightbox worked and show slideshow But after click to any tabs ( tab2 / tab3 / etc ... ) and back to default page ( images gallery ) colorbox not work !!!

How To fix This!?

01-23-2011, 05:43 PM
How are you initializing ColorBox and what's the id of your display area for the tabs script?

If I have those and you're using the correct versions* of jQuery and ColorBox, I can probaly give you a live ColorBox init that will replace your current one. It will activate ColorBox on the default content - any imported content as well if it fits the criteria, when it appears in the display area.

*ColorBox v1.3.15 (the one at the link in your post)
*jQuery v1.3.2 or greater

why not
01-24-2011, 08:52 AM
My ColorBox Version is : 1.3.15 and jquery 1.4.2 . i tested with this now. when default tab change to tabs 2,3,4 etc.. and back to default page ! not work colorox lightbox for images.

01-24-2011, 09:38 AM
You need to answer the question:

How are you initializing ColorBox and what's the id of your display area for the tabs script?

If you don't understand what I'm asking for and you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

But, for example, working from their example1 index page, this was transformed:

//Examples of how to assign the ColorBox event to elements


$("#contentarea a[rel='example1']").live('mousedown', function(e){
var a = this;
$('#contentarea ' + a.tagName + '[rel="' + a.rel + '"]').colorbox();

Where contentarea is the name of the display area for Tab Content.

I could do the same for your initialization if I know what it is, and what the id of the Tab Content display area is.

why not
01-24-2011, 05:58 PM
I understand your mean And Fixed my code with your nicely helped ! Thanks alot john you'r Best Js Coder.

Best Regards.