admin管理员组

文章数量:1023667

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});

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});

本文标签: javascriptCufon textShadowhover problemStack Overflow