13 replies [Last post]
CityChick
Offline
newbie
Last seen: 15 years 24 weeks ago
Joined: 2005-08-09
Posts: 2
Points: 0

Does anyone know of a way that I can get a link to change black when the mouse hovers on it and then change back to its previous color without the mouse leaving the link?

Thanx \:D/

GatorSr
Offline
Regular
Last seen: 15 years 24 weeks ago
Timezone: GMT-5
Joined: 2005-08-06
Posts: 42
Points: 0

Single Blink on a:hover

No. Hover can only have one attribute for text color.

At the moment 10 people have viewed this post with no answer. Most are probably wondering 'why?'. You could perhaps create a special effect with javascript and graphics, and still the question would be 'why?'.

GatorSr
Be Nice to Everyone
Read Hebrews 132

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 2 weeks 4 days ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9774
Points: 3856

Single Blink on a:hover

Hi CityChick and GatorSr, welcome to the forums.

This will take javascript to do the dirty. I'm with Gator on this. I can't think of a sane reason for doing it. Smile.

I'm guessing there are more elegant and more re-usable ways to do this, but here's something to get by on;

<p><a href="#" 
      id="blinker" 
      style="color: blue;" 
      onmouseover="l=document.getElementById('blinker'); 
         this.style.color='red'; 
         setTimeout('l.style.color=\'blue\'',1000);"> 
    sample link</a></p>

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 7 years 26 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Single Blink on a:hover

I'm going to side with CityChick on this one, in part because she sounds sexy Laughing out loud

A marked graphical change on the hover can add a bit of positional confirmation in a usability sense, although I would not then have the link revert, else the user might think they have wandered off the link. Usability techniques and flourishes like this are often used in Flash sites (spit) where a button expands on the hover, then contracts and stays a different colour during the hover. It can work well if handled with care.

I have done similar things in the past using small animated gifs. For example, a menu link might have a background image that looks like a thick underline, and the hover image might be the same type of line but in a different colour. If you create the hover image as an animated gif, then you can have it glow (or grow) for a second before ending on the changed colour. I've even made such a line 'pulse' before now, a bit like Mac OSX buttons do when they want your attention.

I hope I've made myself clear :?

Life's a b*tch and then you die!

HellsBells
HellsBells's picture
Offline
Leader
Bedford, UK
Last seen: 12 years 38 weeks ago
Bedford, UK
Joined: 2004-04-07
Posts: 851
Points: 0

Single Blink on a:hover

roytheboy wrote:
I'm going to side with CityChick on this one, in part because she sounds sexy Laughing out loud

Laughing out loud Laughing out loud Naughty!

My strategy is so simple an idiot could have devised it!

"Also, your CSS (no offence) makes me want to gouge my eyes out with a rusty spoon" - TPH

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 2 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Single Blink on a:hover

Quote:
I hope I've made myself clear
As mud Smile

All this would have me doing is wildly thrashing the mouse around trying to regain the focus that I had lost, and wondering what was wrong.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 2 weeks 4 days ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9774
Points: 3856

Single Blink on a:hover

I can see RTB's point. The change/change-back action should be accompanied or closely followed by another action that remains static for the duration of the mouseover event.

Might be fun to play with.

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 7 years 26 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Single Blink on a:hover

Hugo wrote:
Quote:
I hope I've made myself clear
As mud Smile

Then let me try an example. [tap, tap, tap, tap] Okay, not the best example in the world but imagine the attached graphic is light blue by default (the text would be text if you know what I mean). It turns black on the hover, then fades to dark blue immediately after. This would happen quicker than illustrated in my example. When you come off the hover it changes back to light blue again. I've seen similar embellishments used very well elsewhere, I just can't find any examples right this minute. Clients like this sort of thing because it adds a bit of eye candy without too much pain.

Life's a b*tch and then you die!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 2 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Single Blink on a:hover

I was joking :roll: *tut tut* talk about sense of humour failure.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 7 years 26 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Single Blink on a:hover

But you weren't joking here Hugo old chap...

Hugo wrote:
All this would have me doing is wildly thrashing the mouse around trying to regain the focus that I had lost, and wondering what was wrong.

...so I thought I'd try and clarify my point anyway, because the technique can work well if done properly Smile

Life's a b*tch and then you die!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 2 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Single Blink on a:hover

I was joking really Roy, but see how my thrashing mouse would seem to be in reference to your explanation, but it wasn't, twas just my poor attempt at humour, pardon me ! Sad

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 7 years 26 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Single Blink on a:hover

No no sir; pardon me :oops:

Life's a b*tch and then you die!

CityChick
Offline
newbie
Last seen: 15 years 24 weeks ago
Joined: 2005-08-09
Posts: 2
Points: 0

Awesome!

Thanx, Gary! I changed the 1000 to 100 and it works beautifully!

=D>

Ps, roytheboy: Wink

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 7 years 26 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Re: Awesome!

CityChick wrote:
Ps, roytheboy: Wink

Life's a b*tch and then you die!