views:

932

answers:

1

How can i get the :hover in css stylesheet on the fly with jquery?

stupid example:

a.foo {
    color: red;
    font-size: 11px;
}

a.foo:hover {
    color: blue;
    font-size: 12px; 
}

how to retrieve that color and font-size before that mouse will go over the anchor?

+1  A: 

Take a look at Extra selectors for jQuery.

Also, you can use the hover event, depending on what you want to achieve. See: jQuery hover and class selector.

Can Berk Güder
not bad these extra selectors, but are they supported by jQuery 1.3? Yes i use the hover event already, but i need to make an "hover" script "general purpose", so it may be comfortable change the style directly on the css stylesheet and not passing directy styles to the function/object.
avastreg
@avastreg: I haven't used them either, so I don't know if they work at all =)
Can Berk Güder