You may want to look at this plugin by Ariel Flesler for accessing css
rules:

http://plugins.jquery.com/project/Rule

http://flesler.blogspot.com/2007/11/jqueryrule.html

- Richard

On Wed, Mar 25, 2009 at 2:42 AM, Alexandre Plennevaux <[email protected]
> wrote:

> hello!
>
> i first posted this in the mailing list but no replies tells me my answer
> is no, so this becomes a "feature request"
>
> imagine i style the :hover pseudo-class of an element via css:
>
> .myitem{
> background-color:green;
> }
> .myitem:hover{
> background-color:red
> }
>
> Is it possible to retrieve the background-color property of the
> elemnent's :hover class via jquery?
>
> i tried the obvious : http://jsbin.com/idudi/edit
>
> $(function(){
> var temp = $('#myitem:hover').css('background-color');
> alert("color is "+temp);
>
> });
>
> But that didn't work. It returns the default state.
>
> the reason i'm asking this feature, is because semantically/structurally,
> the best place to store a css property is obviously in the CSS, not in some
> sort of metadata.
> It occurred me while doing an interaction prototype for my school website :
> http://pixeline.be/test/heaj/colormap/colorfade.html
> each link has its background color fade to a custom color. I could only
> store it as metadata or custom attribute, i wish i could have just retrieved
> it from the css.
>
> thank you for listening !
>
> Alexandre
>
> >
>

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

Reply via email to