Just a friendly old digital signature.
On Sep 1, 2006, at 9:05 AM, Ryan Gahl wrote: Sorry, I have nothing to add to this thread... just curious, Brad, about the smime.p7s attachment in your reply. What is that?
On 9/1/06, Brad Ediger < [EMAIL PROTECTED]> wrote:On Sep 1, 2006, at 7:51 AM, Sam wrote:
> > The one and only way to pre-hide stuff with Prototype and therefore > script.aculo.us is a small sin: use inline style="display: none" on > your element's HTML. > -------------------------------------- > I discovered this by trial-and-error myself, but I never took it so > far as to understand *why* hiding a div with a class doesn't > work with Effect.Grow . > > Anyone know? > > Sam > > .hide {display:none} > > <div class=".hide">... Whatever</div> >
Here's my understanding of how this works:
Element.show() (which Effect.Grow uses) works by dynamically setting the "display" property to '' (the empty string). It does this because it has no way of knowing whether your original element was block, inline, inline-block, list-item, or whatever.
With an inline style, this will overwrite your "display: none" and show the element. However, if there is a rule in an attached stylesheet that provides a definition for "display" that is more specific than '', it will be used.
Keep in mind that this has nothing to do with CSS inheritance or specificity: the JS-applied style has higher specificity than the CSS rule from the external file anyway. It has to do with the fact that '' is not a valid value for the display attribute, but is kind of interpreted as "default".
Therefore, Element.hide() (which sets display to "none") should have no such restrictions. JS and CSS gurus, feel free to correct my semi-technical explanation here :-)
--be
-- Ryan Gahl Application Development Consultant Athena Group, Inc. Inquire: 1-888-919-8700 x2903 Blog: http://www.someElement.com --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
|
smime.p7s
Description: S/MIME cryptographic signature