May 25, 2003

Changing Links in a fantastic way.

Stuart Robertson wrote an excellent article, “The Search for the Missing Link”, that shows a powerful way to highlight and accentuate links. It's done through CSS and the :hover pseudo-class. It does work in Mozilla, Netscape 6+, Opera 7, Safari and Camino. And it is beautiful. ( via Zeldman ) UPDATE: Now there has been discussion here about other ways to let the other browsers (IE) see this cool effect. Thank you Eliot, Eric and Nate for the wonderful suggestions and solutions. Eric came up with a nice, simple Javascript solution. The only downside I see to this solution is that does require individual coding for each <p> tag. But it's a simple enough javascript solution. Then Nate Steiner came up with a pure CSS solution that uses the :not pseduo-selector. It works. And is slick. And is only CSS. SON OF UPDATE: Anne has created an elegant javascript DOM solution that doesn't require any recoding of your pages. This works for IE. And it's a small, elegant script. Nice job Anne.
Post Info

Tagged As CSS, Coding, Design, HTML, Javascript

Comments are Open (11)

Posted at 01:37 PM

Comments

eliot

I wonder if some javascript could be whipped together to produce the same effect for other browsers..

Tony

It probably could. But I'd imagine it'd be a complex one, as you would have to create a DOM effect that would check the OnMouseOver state for the paragraph, and then cycle through each of the links within that paragraph. Not what I would call simple.

I'll just keeping holding out faith that IE will be upgraded sometime soon. (how deluded is that?)

Eric

The CSS version is definitely cooler, but doing it in javascript is pretty trivial:

http://www.ajah.com/hover_p.html

Its a pretty kick-ass effect, I'm going to have to find a place to use it.

Tony

Wow. That is simple. And effective.

Now I feel like a dumbass saying how difficult it would be. Never even TRIED to think of the easiest solution. This is defintely a very cool solution. Nice job.

Eric

The simple technique used there pretty ameliorates IE's lack of universal :hover support and lets you do most of the cool things people are doing w/CSS these days. I would absolutely prefer to do it in CSS, but considering how simple it is, I can deal.

Nate

I just threw together a variation on the original (non-javascript) solution, I think my version offers just a bit more backwards compatibility for non p:hover supporting browsers. Rather than emulating the functionality with javascript, I am degrading to show the links with an alternate color.
It may be a bit too exclusive, I don't know how many browsers support p:hover but *dont* support :not. Tested to work on Mozilla based browsers and Safari, tested to degrade in Windows IE. I'd be interested to see if this experement actually holds up with other browers, or if it's even worth using.
I suppose you actually get 5 different "states" this way: off, over, hover and degraded off, degraded hover.

http://web-graphics.com/tests/phover.html

eliot

Sweet. :)

Tony

http://www.web-graphics.com/mtarchive/000878.php

Got a nice write up over at web-graphics thanks to Nate.

Anne van Kesteren

I made a DOM solution for MSIE, without the attributes within the p element.

http://www.annevankesteren.nl/test/phover/

I hope you like it!

ogbu

plez happy to hear from u bebe
urs brother
otse

West

Mark Twain was wrong. Some of the most influential folks I know where very little in the way of clothing.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Search
Comments on this post
Categories
Info
Tony Stephens
Copyright © 1995-2005
Site Version:
10
Licensed:
Creative Commons
Validate:
XHTML, CSS, 508, RSS
Subscribe
Blog-Fu, Link-Fu