What I've used to grab styles from the stylesheets (though never for
pseudo classes; please try it!) is:
        function getStyle (selector){
          var re = new RegExp('(^|,)\\s*'+selector.toLowerCase()+'\\s*(,|
$)');
          var style = "";
                each ($.makeArray(document.styleSheets), function(){
                        each (this.cssRules || this.rules, function(){
                                if (re.test(this.selectorText)) style += 
this.style.cssText + ';';
                        });
                });
          return style;
        }


and use getStyle('a:hover')

This is simplified; it doesn't handle @import and @media or escape
special characters, but it ought to work.

Danny

On Mar 26, 6:22 am, Alexandre Plennevaux <aplennev...@gmail.com>
wrote:
> i'm just trying to be as semantically correct as possible.
>
> say i want links to change their background color when the mouse passes over.
> I can do it in css easily
>
> a {
> background-color:red;
>
> }
>
> a:hover{
> background-color:green;
>
> }
>
> now, for those who have javascript,  i want the color change to be an
> animated color blend, from red to green.
> I can of course retrieve the target color (green in this example) by
> storing it via metadata, a custom attribute or the data attribute.
> However, strictly speaking, its correct place is the css file itself,
> where all styling should be.
>
> that's why i wanted to know if i can have access to the css properties
> set in the stylesheet for the :hover pseudo class.
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to