To insert code use <code>...</code>.
Bug? Cufon replace
  • Hello KaptinLin,

    I found a bug i guess. I added the following code:


    Cufon.replace("h1,h2,h3,h4,h5", {fontFamily : "verdana"});


    Now when i open a page the menu is first completely in Verdana. However when you hover the menu items they switch to my cufon font ans stay that way until the page is loaded again. Then the whole thing repeats itself.

    Please look into this

    Best regards,
    BackuPs
  • 10 Comments sorted by
  • You're basically trying to use two fonts with Cufon.replace, which I had a few issues with as well. Be very explicit which styles you want each font applied to, then you have to make a few changes to js files, depending on your usage. Try this:

    First, change the line to:
    Cufon.replace("h1,h2,h3,h4,h5,#navigation a", {hover:true,fontFamily : "verdana"});

    Second, in js/jqueryslidemenu.js, go to the section where it checks to see if cufon font is defined, and comment it out (or remove it).

    Kaptilin - any other suggestions?
  • Hello Jmarkadams,

    Thanks for the hint,

    It means that i have to modify the jqueryslidemenu.js at every striking update?

    What i want is that the menu is cufon and the h1 until h5 are verdana.

    I do not understand why my cufon override, effects the menu items on page load. Because when i hover the menu-items they change to the correct cufon font.

    I hope kaptinlin has a solution for this.

    Best regards,
    BackuPs
  • Hi BackuPs,
    Do you use two cufon font on the page?

    If so, you should do as jmarkadams suggestion.

    Regards,
    KaptinLin
  • Hello kaptinlin,

    No i just use one cufon plus the additional h1 replace as above.

    As i said on page load the menu switches to verdana. Hovering the menu it switches to cufon.

    So what has my h1..h5 replace todo with the menu?

    Try it yourselves.
    1) Activatejust one cufon
    2) set the navigation button style to ON and
    3) add the h1 to h5 replace as above.

    Now see what the menu does on page load.

    You will see that the menu first is verdana and after a hover cufon.

    Looking forward to your reply,

    best regards
    BackuPs
  • Hi,
    You can edit on 'striking/js/jqueryslidemenu.js'

    comment or remove line 26 & 32

    Cufon.replace($('> a',this));

    Regards,
    KaptinLin
  • Hello KaptinLin,

    Thank you,

    Does this mean i have to edit this file every striking update?

    Best regards,
    BackuPs
  • Of course. Sorry for the inconvenience.

    If you don't want. You can try use fontface instead of.
  • BackuPs:
    You're only using one Cufon font, but since you want to apply Verdana to other styles normally replaced by cufon, you have to treat Verdana as another cufon font. I had thought of using fontface instead also, but opted for Cufon due to the ability to generate custom fonts (i like to use Zapfino for some headers, and only cufon allows me to do this). Based on your reply, try this:

    insert this code into the cufon page:
    Cufon.replace("h1,h2,h3,h4,h5", {hover:true,fontFamily : "verdana"});
    Cufon.replace('#navigation a', {hover:true,fontFamily : "insert-your-cufon-font-here"});

    then change jqueryslidemenu as KaptinLin indicates above - comment out Cufon.replace($('> a',this));

    That should do it. And yes, you will have to do this every update. I keep a small list of the file changes I make each time. A little inconvenient, but not too difficult.
  • It took me a while to figure out what's going on with Cufon replacement. But what I understand is:
    - you can use only 1 Cufon font if you don't use code replacement. This font will be used for h1,h2,h3,h4,h5 and the top menu.
    - if you use code replacement, then you should change the jqueryslidemenu.js
    - if you don't want to change the .js but want a 2nd fonr then you want to use @font-replace

    Is this correct?

    Thanks,
    Erwin