最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Cufon textShadow + hover problem - Stack Overflow

matteradmin6PV0评论

I only want the text-shadow to be on the hover state.

**JS**
Cufon.replace('.headerright', {hover: true,'fontFamily' : 'League Gothic',textShadow:'0px 1px #cccccc'});
**CSS**
.headerright{text-transform:uppercase; font-size:76px;color:#CD7674;}
.headerright a:hover{color:#444444;}

I only want the text-shadow to be on the hover state.

**JS**
Cufon.replace('.headerright', {hover: true,'fontFamily' : 'League Gothic',textShadow:'0px 1px #cccccc'});
**CSS**
.headerright{text-transform:uppercase; font-size:76px;color:#CD7674;}
.headerright a:hover{color:#444444;}
Share Improve this question edited Aug 2, 2011 at 0:47 ThomasReggi asked Jun 12, 2010 at 23:07 ThomasReggiThomasReggi 59.8k97 gold badges260 silver badges460 bronze badges 2
  • 2 Sorry, I've never used cufon, but I think it's now better to start using the @font-face and shadows as part of CSS3... Paul Irish published a bullet proof method that even works with IE (paulirish./2009/bulletproof-font-face-implementation-syntax) – Mottie Commented Jun 13, 2010 at 0:32
  • Thanks fudgey, will start testing that approach tomorrow, very interesting! – danjah Commented Jul 19, 2011 at 12:51
Add a ment  | 

2 Answers 2

Reset to default 3

Your code is defining textShadow from the get-go rather than for the hover event.

Looking at https://github./sorccu/cufon/wiki/styling, this should work for you:

Cufon.replace('.headerright', {
    'fontFamily': 'League Gothic',
    hover: {
        textShadow: '0px 1px #cccccc'
    }
});
Cufon.replace('.menu_item', {fontFamily: 'museo700_regular',hover: {textShadow: '0px 1px #fff'},textShadow:'0px 1px #fff', hover:true});
Post a comment

comment list (0)

  1. No comments so far