On Nov 6, 12:52 am, ekallevig <[EMAIL PROTECTED]> wrote:
> I'm a little confused about prototype's hide/show methods. In the api,
> it says that "Element.show cannot display elements hidden via CSS
> stylesheets. Note that this is not a Prototype limitation but a
> consequence of how the CSS display property works."
>
> I know that if you set display to an empty string '' instead of block,
> you can achieve the hide/show effect via stylesheet. I also know that
> jQuery's hide/show methods seem to be able to handle elements hidden
> via stylesheet with no problem (just look at the basic example on
> their homepagehttp://jquery.com/).  Is there a way to achieve this in
> prototype?  And why are they saying that it's a CSS limitation? What
> am I missing?

When you set an element's style.display property to an empty string
(which is what Prototype.js does), you are letting it adopt a display
property either by inheritance from an element higher in the DOM tree
or by CSS, which may mean that the element is still not visible.

jQuery takes a different approach and may set the display property to
block instead of empty string, however will may still not be visible
if a parent element is not.


--
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 [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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to