# Page.show only works if "display: none" is inline style?

**URL:** <https://www.ruby-forum.com/t/page-show-only-works-if-display-none-is-inline-style/88950>\
**Category:** Rails\
**Created:** [March 15, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/page-show-only-works-if-display-none-is-inline-style/88950 "2007-03-15T21:06:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 15, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/page-show-only-works-if-display-none-is-inline-style/88950/1 "2007-03-15T21:06:11Z")

</div>

All,

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 page.show(‘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.

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 15, 2007, 9:44pm UTC](https://www.ruby-forum.com/t/page-show-only-works-if-display-none-is-inline-style/88950/2 "2007-03-15T21:44:34Z")

</div>

> Has anyone ever seen this behavior before?

Yes…

[http://wiki.script.aculo.us/scriptaculous/show/Element.show](http://wiki.script.aculo.us/scriptaculous/show/Element.show)

The output is a little wonky, but at the top it says that you either  
need  
to have hidden it first using Element.hide or using an _inline_ css  
rule.
