Results 1 to 2 of 2

Thread: DD tabs + jQuery toggle Div? Turn OFF page caching?

  1. #1
    Join Date
    Nov 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DD tabs + jQuery toggle Div? Turn OFF page caching?

    1) Script Title: Ajax Tabs Content

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...axtabscontent/

    3) Describe problem:

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

    http://www.americansongspace.com/beta/writerBackend.php

    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.
    Last edited by ddadmin; 11-28-2007 at 11:32 PM.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    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 on how to use this event handler. The result is something like:

    Code:
    var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
    countries.setpersist(true)
    countries.setselectedClassTarget("link") //"link" or "linkparent"
    countries.init()
    
    countries.onajaxpageload=function(pageurl){
    if (pageurl.indexOf("myscoop.htm")!=-1){ //if "myscoop" tab is clicked
    //Call jQuery toggle DIV initialization code
    }
    }

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
  •