Forum: Ruby on Rails only works if "display: none" is inline style?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Wes G. (Guest)
on 2007-03-15 22:06

I have a div that I want to be hidden when the page displays, but then
have RJS code which will show it later (via either'elem_id')
or page['elem_id'].show).

If the "display: none" style for this element is specified in my
external stylesheet, I am unable to successfully show this element using
either of the methods mentioned above.  If, however, I specify "display:
none" as an inline style on the element, then the RJS code to show the
element works.

Has anyone ever seen this behavior before?

As an aside, doing

page << "$('elem_id').style.display = 'block';

always works regardless of how the display: none is specified.

Philip H. (Guest)
on 2007-03-15 22:44
(Received via mailing list)
> Has anyone ever seen this behavior before?


The output is a little wonky, but at the top it says that you either
to have hidden it first using Element.hide or using an *inline* css
This topic is locked and can not be replied to.