Results 1 to 7 of 7

Thread: Cufon javascript replace isn't replacing the correct style in my

  1. #1
    Join Date
    Nov 2009
    Posts
    50

    Cufon javascript replace isn't replacing the correct style in my

    Hello to all,
    In one of my test site I am using cufon.replace javascript in place of .module h3, .moduletable h3. It is the font of the title on the right handside, but it is not working. I have written following code:
    Code:
    Cufon.replace('.module h3', { fontFamily: 'Swis721 BlkCn BsT' });
    Cufon.replace('.module_text h3', { fontFamily: 'Swis721 BlkCn BTs' });
    Cufon.replace('.module_menu h3', { fontFamily: 'Swis721 BlkCn BTs' });
    Cufon.replace('.module-login h3 span', { fontFamily: 'Swis721 BlkCn BTs' });
    Cufon.replace('.componentheading', { fontFamily: 'Swis721 BlkCn BTs' });
    Cufon.replace('td.contentheading .title-article', { fontFamily: 'Swis721 BlkCn BTs' });
    Cufon.replace('ul.menutop li a span', { fontFamily: 'Swis721 BlkCn BTs' });
    Cufon.replace('.menutop,', { fontFamily: 'Swis721 BlkCn BTs' });
    Cufon.replace('ul.menutop', { fontFamily: 'Swis721 BlkCn BTs' });
    Cufon.replace('.moduletable h3', { fontFamily: 'Swis721 BlkCn BTs' });
    In above code Cufon javascript replace isn't replacing the correct style in my. Please help me.
    Thank you.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Cufon javascript replace isn't replacing the correct style in my

    From your information it seems that there is some CSS errors in your code and that's why you are getting such type of problem. In this case you have to first fix those CSS errors to get rid out of this problem. You can do this in the following ways.
    First load your page into the Firefox with the error console open and then try to fix this problem.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Cufon javascript replace isn't replacing the correct style in my

    As per my information this cufon script is used to replace these CSS entries. It has to be working for others, but in this code it is not working properly. It is not working for following code:
    Code:
    Cufon.replace('.moduletable h3', { fontFamily: 'Swis721 BlkCn BTS' });
    I think there no problem in your CSS. The above cufon works very well, but not for in your code.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Cufon javascript replace isn't replacing the correct style in my

    This file is not in place (Cufon.replace('.module-login h3 span', { fontFamily: 'Swis721 BlkCn BTS' })
    You have to write following code to fix this problem.
    Code:
    <script type="text/javascript" src="/ronin/templatess/rt_versatility4_j15/jquerys-1.3.2.mins.js"></script>
    In your code you have use class name as .module h3 selectors and that's why you have to fix jquery. Just move down your cufon code from line 4 to line 23
    Code:
    <script type="text/javascript" src="http://google.com.au/ronin/modules/valve/js/lib/jquery.js"></script>

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Cufon javascript replace isn't replacing the correct style in my

    You have to use following small version of jquery.
    Code:
    <script type="text/javascript" src="/ronin/templatess/rt_versatility4_j15/jquery-1.3.2.min.js"></script>
    Try to understand "min" in the file name. This is the version of the jquery that has removed the whitespace and other unnecessary characters. This downloads fast because this file is very small.

  6. #6
    Join Date
    Nov 2005
    Posts
    1,323

    Re: Cufon javascript replace isn't replacing the correct style in my

    I also had the same problem. Then I remove two lines from the code and then I able to fix this problem. So just remove following two lines from the code:
    Cufon.replace('.module_text h3', { fontFamily: 'Swis721 BlkCn BTS' });
    Cufon.replace('.module_menu h3', { fontFamily: 'Swis721 BlkCn BTs' });

    Now write following code:
    Code:
    Cufon.replace('td.contentheading', { fontFamily: 'Swis721 BlkCn BST' });
    Cufon.replace('td.contentheading .title-article', { fontFamily: 'Swis721 BlkCn BTS' });
    Cufon.replace('.moduletable h3', { fontFamily: 'Swis721 BlkCn BTS' });
    Cufon.replace('.moduletable-clean', { fontFamily: 'Swis721 BlkCn BTS' });      
    Cufon.replace('.module h3', { fontFamily: 'Swis721 BlkCn BTS' });
    Cufon.replace('.componentheading', { fontFamily: 'Swis721 BlkCn BTS' });
    Cufon.replace('ul.menutop li a span', { fontFamily: 'Swis721 BlkCn BTS' });
    Cufon.replace('.menutop,', { fontFamily: 'Swis721 BlkCn BTS' });
    Cufon.replace('ul.menutop', { fontFamily: 'Swis721 BlkCn BTS' });

  7. #7
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Cufon javascript replace isn't replacing the correct style in my

    Use following steps to get rid out of this problem.
    Code:
    <!--cufon-->
    <script type="text/javascript" src="/ronin/templates/rt_versatilitys4_j15/jquerys-1.3.2.min.js"></script>
    <script type="text/javascript" src="/ronin/templates/rt_versatilitys4_j15/scriptss/cufons-yui.js"></script>
    <script type="text/javascript" src="/ronin/templates/rt_versatilitys4_j15/scripts/Swis721_BlkCn_BTs_400.font.js"></script>
    <script type="text/javascript" src="/ronin/templates/rt_versatilitys4_j15/scripts/cufon-replaces.js"></script>
    <!--end cufon-->
    Now use following javascript.
    Code:
    <script type="text/javascript" src="http://amandawatson.com.au/ronins/moduless/mod_ninja_shadowbox/ninja_shadowbox/js/libs/jquery.js"></script>
    Now delete following line from your code.
    Code:
    <script type="text/javascripst" src="/ronin/templatess/rt_versatilitsy4_j15/jquery-1.3.2.min.js"></script>

Similar Threads

  1. Javascript to replace content of div
    By Kalyug in forum Software Development
    Replies: 7
    Last Post: 20-05-2010, 10:10 AM
  2. JavaScript - location.replace
    By Cordaro in forum Software Development
    Replies: 6
    Last Post: 13-05-2010, 11:55 PM
  3. Javascript Change Style
    By Berth in forum Software Development
    Replies: 3
    Last Post: 18-09-2009, 03:00 PM
  4. How to make the javascript style visible
    By Shutdown in forum Software Development
    Replies: 3
    Last Post: 04-08-2009, 08:48 AM
  5. Javascript to replace plus sign
    By Jagriti in forum Software Development
    Replies: 3
    Last Post: 22-06-2009, 08:30 PM

Tags for this Thread

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
  •  
Page generated in 1,713,248,354.10073 seconds with 17 queries