prevent hover set by the CSS
Posted
by meo
on Stack Overflow
See other posts from Stack Overflow
or by meo
Published on 2010-05-02T18:53:49Z
Indexed on
2010/05/04
23:08 UTC
Read the original article
Hit count: 263
jQuery
|JavaScript
I try to prevent the Browser from using the :hover
effect of the CSS.
$("ul#mainFilter a").hover(
function(o){ o.preventDefault(); ...do my stuff... },
function(o){ o.preventDefault(); ...do my stuff... });
I tired it with return false;
to but it does not work.
Does anyone know how to do this?
due the answers i give you some more nfo:
I have set the a
and a:hover
styles, in my CSS already. Now if JS is available on the clients machine, i want to overwrite the effect with a smoother one. (using jQuery color plugin)
As mentioned by fudgey, a work around would be to set the style (using .css()
) but i would have to overwrite every single effect specified in the CSS (see here: http://jsfiddle.net/raPeX/1/ ). I am looking for a generic solution.
© Stack Overflow or respective owner