Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: cufon refresh in AJAX Tabs

  1. #1
    Join Date
    Feb 2007
    Posts
    39
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    How can i add to reaload cufon.js in that script, i need it to get the fonts inside the AJAX tabs, if is to difficult i can use a regular font, but it would be nice if there is an easy way. and i think cufon is one nice script for fonts.

    thanks! in advance, would be great to know your opinion

    how can i use Cufon.refresh? i have no idea but i found that in a research.
    Last edited by jscheuer1; 03-07-2012 at 10:17 AM.

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

    I don't know, is it:

    Code:
    cufon.refresh()
    or:

    Code:
    Cufon.refresh()
    ?

    Whichever, you can (in the ajaxtabs.js file) put it in the:

    Code:
    ddajaxtabs.loadpage=function(page_request, pageurl, tabinstance){
    	var divId=tabinstance.contentdivid
    	document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"
    	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
    		document.getElementById(divId).innerHTML=page_request.responseText
    		ddajaxtabs.ajaxpageloadaction(pageurl, tabinstance)
    		cufon.refresh();
    	}
    }
    function.

    Or add an instance.onajaxpageload to the on page setup, ex:

    Code:
    <script type="text/javascript">
    
     var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
     countries.setpersist(true)
     countries.setselectedClassTarget("link") //"link" or "linkparent"
     countries.init()
    
     countries.onajaxpageload=function(pageurl){
     cufon.refresh();
     }
    
     </script>
    as described on:

    http://www.dynamicdrive.com/dynamici...uppliment3.htm
    - John
    ________________________

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

  3. #3
    Join Date
    Feb 2007
    Posts
    39
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    thanks very much, y try the two solutions, with cufon and Cufon, and its not working, =(, when i change from one tab to other the cufon is bypass , i think because the html is loaded after cufon so is not converted.

    thanks anyway, any other way i can try?

  4. #4
    Join Date
    Feb 2007
    Posts
    39
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Its working!, well almost, in the TAB1, or rel="#default" , its not working.

    i can load external html and cufon its working XD!,

    but on the default tab, when i come back, its not working :O. thanks XD

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

    It would help to know what worked.

    And I'm not surprised. The default tab isn't loaded via AJAX.

    I'd try:

    Code:
    <script type="text/javascript">
    document.onclick = function(e){
    	e = e || event;
    	var t = e.target || e.srcElement;
    	if(t.rel === '#default'){
    		Cufon.refresh();
    	}
    };
    </script>
    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  6. #6
    Join Date
    Feb 2007
    Posts
    39
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    yes ofcourse, this is the correct solution

    Code:
    <script type="text/javascript">
    
    var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
    countries.setpersist(true)
    countries.setselectedClassTarget("linkparent") //"link" or "linkparent"
    countries.init()
    
     countries.onajaxpageload=function(pageurl){
     Cufon.refresh();
     }
     
     
    
    </script>



    And for the issue on the #default tab dosent work, do i have to put that script on the header?

  7. #7
    Join Date
    Feb 2007
    Posts
    39
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    For the tab issue i solve it modifying your script, i refresh cufon on every clic but i dont think thats a problem

    Code:
    <script type="text/javascript">
    document.onclick = function(){
    	Cufon.refresh();
    	}
    </script>

  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 could, but it's code could go with what you have, and a little error checking wouldn't hurt, so we could have:

    Code:
    <script type="text/javascript">
    
    var countries=new ddajaxtabs("countrytabs", "countrydivcontainer");
    countries.setpersist(true);
    countries.setselectedClassTarget("linkparent"); //"link" or "linkparent"
    countries.init();
    
    countries.onajaxpageload = function(pageurl){
    	if(typeof Cufon !== 'undefined'){
    		Cufon.refresh();
    	}
    };
    
    document.onclick = function(e){
    	e = e || event;
    	var t = e.target || e.srcElement;
    	if(t.rel === '#default' && typeof Cufon !== 'undefined'){
    		Cufon.refresh();
    	}
    };
    
    </script>
    - John
    ________________________

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

  9. #9
    Join Date
    Feb 2007
    Posts
    39
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thanks for that i just notice the tab when selected change the color of the text, but the "selected" tab wont change, do i make something wrong.

    http://dreaminmedia.com/agatha/index.html

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

    Unless the answer is, "Because it's already changed", you've lost me there.

    Could you be more specific?
    - John
    ________________________

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

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
  •