Hello, How can I get the styles of the :hover state of a link defined in a css stylesheet? Is it possible? Regards --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Lox wrote:> Hello, > > How can I get the styles of the :hover state of a link defined in a > css stylesheet? > > Is it possible? > > RegardsThe only way I know of is to iterate through the document.styleSheets collection. See quirksmode.org for cross-browser implementation information: http://www.quirksmode.org/dom/changess.html http://www.quirksmode.org/dom/w3c_css.html - Ken Snyder --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
bram.vandersype-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Apr-18 12:32 UTC
Re: Retrive :hover styles
Hmm, I think the "easiest" way to do this would be rewriting the hover effect with JS... Observe all links, if the mouse moves over them, add a class (like .hover)... that way, it''d be easy getting the styles from the class... On 17 apr, 14:17, Lox <laurent.dincl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > How can I get the styles of the :hover state of a link defined in a > css stylesheet? > > Is it possible? > > Regards--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I disagree with Bram, @bram: As web developers we should aim for progressive enhancement only, meaning that javascript shouldn''t be used for rollovers if there is a javascript-free alternative (:hover, in this instance). I have never used document.styleSheets but it may be the way forward, alternatively add an event to the rollover element that observes ''mouseover'', and getStyle() from there. It''s a bit backwards in coming forwards, but will solve your problem. P.S., I''ve never done this myself, but am looking into document.styleSheets now. On Apr 18, 1:32 pm, "bram.vanders...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <bram.vanders...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hmm, I think the "easiest" way to do this would be rewriting the hover > effect with JS... Observe all links, if the mouse moves over them, add > a class (like .hover)... that way, it''d be easy getting the styles > from the class... > > On 17 apr, 14:17, Lox <laurent.dincl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello, > > > How can I get the styles of the :hover state of a link defined in a > > css stylesheet? > > > Is it possible? > > > Regards--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
bram.vandersype-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Apr-27 10:44 UTC
Re: Retrive :hover styles
Yeah, I totally agree. I''d never do it either, it was just the only way I could think off right off the bat... On 18 apr, 21:43, redheat <ecouch...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> I disagree with Bram, > > @bram: As web developers we should aim for progressive enhancement > only, meaning that javascript shouldn''t be used for rollovers if there > is a javascript-free alternative (:hover, in this instance). > > I have never used document.styleSheets but it may be the way forward, > alternatively add an event to the rollover element that observes > ''mouseover'', and getStyle() from there. It''s a bit backwards in coming > forwards, but will solve your problem. > > P.S., I''ve never done this myself, but am looking into > document.styleSheets now. > > On Apr 18, 1:32 pm, "bram.vanders...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" > > <bram.vanders...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hmm, I think the "easiest" way to do this would be rewriting the hover > > effect with JS... Observe all links, if the mouse moves over them, add > > a class (like .hover)... that way, it''d be easy getting the styles > > from the class... > > > On 17 apr, 14:17, Lox <laurent.dincl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello, > > > > How can I get the styles of the :hover state of a link defined in a > > > css stylesheet? > > > > Is it possible? > > > > Regards--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---