Results 1 to 9 of 9

Thread: Ajax Tabs Content Script (v 2.2)

  1. #1
    Join Date
    Feb 2008
    Posts
    62
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Ajax Tabs Content Script (v 2.2)

    Hi,
    DD ajax tabs script :
    HTML Code:
    http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/
    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.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    page_request.open('GET', ajaxfriendlyurl+bustcacheparameter, true)
    DD Admin

  3. #3
    Join Date
    Feb 2008
    Posts
    62
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hi,
    You check this address :
    Code:
    http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/
    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 .

    Thanks

  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

    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:

    Code:
    <script type="text/javascript">
    
    var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
    countries.setpersist(false)
    countries.setselectedClassTarget("link") //"link" or "linkparent"
    countries.init()
    
    </script>
    - John
    ________________________

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

  5. #5
    Join Date
    Feb 2008
    Posts
    62
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    found new problem ! i test with php external gallery images and colorbox lightbox! so load external page not worked.
    HTML Code:
    http://colorpowered.com/colorbox/
    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!?

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

    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
    - John
    ________________________

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

  7. #7
    Join Date
    Feb 2008
    Posts
    62
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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.

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

    You need to answer the question:

    Quote Originally Posted by jscheuer1 View Post
    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:

    Code:
    		$(document).ready(function(){
    			//Examples of how to assign the ColorBox event to elements
    			$("a[rel='example1']").colorbox();
    		});
    into:

    Code:
    		$("#contentarea a[rel='example1']").live('mousedown', function(e){
    			e.preventDefault();
    			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.
    - John
    ________________________

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

  9. The Following User Says Thank You to jscheuer1 For This Useful Post:

    why not (01-24-2011)

  10. #9
    Join Date
    Feb 2008
    Posts
    62
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I understand your mean And Fixed my code with your nicely helped ! Thanks alot john you'r Best Js Coder.

    Best Regards.

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
  •