Monday, January 26, 2009

A:Hover and IE - a trap for young players

If you're having trouble getting your a:hover effect to work in IE you might want to make sure you have an href attribute on the anchor element. The hover effect won't work in IE unless it does.

I had something like the following:

<a onclick="somejavascriptfunction()">Anchor text</a>

Changing to this solved the issue:

<a onclick="somejavascriptfunction()" href='#'>Anchor text</a>

It's a bit embarrassing and I should know better. I hope this post helps other people avoid wasting time like I did.

Labels: ,


Post a Comment

<< Home