I have a question about prototype''s addClassName, removeClassName, and toggleClassName. As expected, these functions add or remove a class name from an element. When adding, the class names are appended to the end of the class list of the element. Could this affect the rendering of the element? Does the order of css class names in the element''s class attribute matter? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Yes, by adding/removing class names you effect the rendering of the element on screen. In fact, this is probably what I use such functions for 95% of the time. It''s especially handy if you know you want to toggle between styles based on user input without reloading the page. For example, you can create different classes for the body tag which control font sizing, for example, and let people click buttons on screen to change the font-size. Then, use add/remove class names to actually apply the font sizing on the fly. As for your second question: does the order of class names matter with respect to the rendering of the object, I''m honestly not sure so I''ll leave that to someone else. - Dash - Hergio wrote:> I have a question about prototype''s addClassName, removeClassName, and > toggleClassName. As expected, these functions add or remove a class > name from an element. When adding, the class names are appended to > the end of the class list of the element. Could this affect the > rendering of the element? Does the order of css class names in the > element''s class attribute matter? > > > > >-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGKNmm6r+BYsa3/iMRCJw/AJsGcEMLiA8BYJwvGdQMvqXitdTurgCcD7Rd KIhc1RwdMh/7Izupa8Rmi30=3TBs -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Dashifen Kees wrote:> As for your second question: does the order of class names matter > with respect to the rendering of the object, I''m honestly not sure so > I''ll leave that to someone else.No it doesn''t. I can''t find the exact reference right now, but the order that CSS rules are applied is related to the order the CSS rules are defined. Class names in HTML elements aren''t strictly for CSS, so there is no constraint placed on how they appear. -- Michael Peters Developer Plus Three, LP --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey there, Hergio a écrit :> rendering of the element? Does the order of css class names in the > element''s class attribute matter?Not that I know of. The order of the classes in the CSS files has impact, due to the algorithm of the cascade. Aside from this, the spec for the class= attribute [1] says nothing about it. [1] http://www.w3.org/TR/html401/struct/global.html#adef-class -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Apr 21, 12:35 am, Hergio <david.herg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a question about prototype''s addClassName, removeClassName, and > toggleClassName. As expected, these functions add or remove a class > name from an element. When adding, the class names are appended to > the end of the class list of the element. Could this affect the > rendering of the element? Does the order of css class names in the > element''s class attribute matter?No. For CSS questions, you will likely get better answers in a CSS group: news:comp.infosystems.www.authoring.stylesheets <URL: http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets?lnk=li>-- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---