treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Cufon link hover state

  • Here is the link to the site I am looking for help on: http://www.lsw-design.com/sgraphics2/

    I have done a few google searches and haven't managed to find anything yet to help solve my problem where the links at the top are not changing colour on hover, i have tried adding {hover: 'true'} which i had seen somewhere before, but it isn't working probably because i haven't done it right. Any ideas?
  • Copy/Paste this in your header, removing the old one.

    <script src="/sgraphics2/js/cufon-yui.js" type="text/javascript"></script>
    <script src="/sgraphics2/js/Officina_Serif_ITC_700.font.js" type="text/javascript"></script>
    <script type="text/javascript">
    Cufon.replace('h1', {hover: 'true'});
    Cufon.replace('h4', {hover: 'true'});
    Cufon.replace('h3', {hover: 'true'});
    Cufon.replace('a', {hover: 'true'});
    </script>
  • Also, not sure why you have a period to hover? Never seen that before.
  • I have a couple questions regarding cufon as well…

    Is there anyway to eliminate the font flicker when sites load?

    I there a way to create selectable text?
  • Regarding font flicker which I'm assuming you mean font jumping?
  • Yes the font jumping
  • I think the best way to fix that is to use a fallback font that is a resemblance of the font you're embedding.
  • thanks
  • Thanks for the help with the cufon stuff, got the hover to work. Now i am having a problem with adding a background image to the hover state, i can get the image to show but as soon as i try to position it at the bottom and to the left undernieth the text the image disapears, not sure what i have done wrong.