View Full Version : DD tabs + jQuery toggle Div? Turn OFF page caching?

11-28-2007, 06:35 PM
1) Script Title: Ajax Tabs Content

2) Script URL (on DD):

3) Describe problem:

Here is the URL to the site we're building:


On the right hand we have set up the Ajax tabs system (brilliant!) and we're wanting to incorporate jQuery toggle divs that you can open/close etc IN our flowerdivcontainer...if you click on the My Scoop tab, the content there SHOULD begin with a hidden jQuery div, however the div usually open... and yet if you Refresh the page, the div is no hidden and functioning correctly. I've looked through the ajaxtabs.js file, is this issue a caching problem? Any insight would be MOST helpful.

11-29-2007, 12:39 AM
Hmm don't you mean the Ajax Tabs script (you referenced another script at the top)? I've edited your post for this.

To your question, this is most likely due to the fact that the content is fetched via Ajax, causing the code that initializes jQuery toggle div to not fire, whatever that is. This can be worked around by using the "onajaxpageload" event handler of Ajax Tabs to call that code when the content has been fully fetched. Please see the tutorial (http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/ajaxtabs_suppliment2.htm) on how to use this event handler. The result is something like:

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

if (pageurl.indexOf("myscoop.htm")!=-1){ //if "myscoop" tab is clicked
//Call jQuery toggle DIV initialization code