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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Mar-15 20:49 UTC
Re: page.show only works if "display: none" is inline style?
> > 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?Yes... 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.> > As an aside, doing > > page << "$(''elem_id'').style.display = ''block''; > > always works regardless of how the display: none is specified.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---