I have a script that tries to hide the contents of a p element. What I''m finding is that, using the hide() method, only the actual p content is hidden. The nested elements are left visible. Is that expected? If so, how can I hide everything? What am I missing? My markup looks like this: <h2>This is an FAQ question</h2> <p> You have 2 options: <ol> <li>Item #1</li> <li>Item #2</li> </ol> </p> Any insight is greatly appreciated. This seems pretty obvious, but the docs don''t explicitly mention anything about how descendant elements are handled. Thanks. rob wilkerson --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey, Rob Wilkerson a écrit :> content is hidden. The nested elements are left visible. Is that > expected? If so, how can I hide everything? What am I missing?That''s because your markup is faulty. You can''t nest <ol>''s into <p>, it''s not valid HTML. So the browser actually puts the <ol> outside the <p> from a rendering perspective. Migrate your <p> to a <div> in this instance (and make the "You have two options:" bit its own <p> inside it), then toggle the <div>. That''ll work. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, Christophe. I actually did consider that, but after looking at the W3C site, that particular configuration looked valid (p elements can contain list elements). Turns out I was looking at the XHTML2 spec. Sorry about that. http://www.w3.org/TR/2003/WD-xhtml2-20030506/mod-block-text.html#s_block-textmodule On 7/12/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> > Hey, > > Rob Wilkerson a écrit : > > content is hidden. The nested elements are left visible. Is that > > expected? If so, how can I hide everything? What am I missing? > > That''s because your markup is faulty. You can''t nest <ol>''s into <p>, > it''s not valid HTML. So the browser actually puts the <ol> outside the > <p> from a rendering perspective. Migrate your <p> to a <div> in this > instance (and make the "You have two options:" bit its own <p> inside > it), then toggle the <div>. That''ll work. > > -- > Christophe Porteneuve aka TDD > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve run into this problem myself where I thought the P tag would be containing other elements. I found out what was going on by looking at the DOM Inspector in Firefox which displayed the element orientation as it had rendered it, not how I had written it. On Jul 12, 9:12 am, "Rob Wilkerson" <r.d.wilker...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks, Christophe. I actually did consider that, but after looking > at the W3C site, that particular configuration looked valid (p > elements can contain list elements). Turns out I was looking at the > XHTML2 spec. Sorry about that. > > http://www.w3.org/TR/2003/WD-xhtml2-20030506/mod-block-text.html#s_bl... > > On 7/12/07, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > > > > Hey, > > > Rob Wilkerson a écrit : > > > content is hidden. The nested elements are left visible. Is that > > > expected? If so, how can I hide everything? What am I missing? > > > That''s because your markup is faulty. You can''t nest <ol>''s into <p>, > > it''s not valid HTML. So the browser actually puts the <ol> outside the > > <p> from a rendering perspective. Migrate your <p> to a <div> in this > > instance (and make the "You have two options:" bit its own <p> inside > > it), then toggle the <div>. That''ll work. > > > -- > > Christophe Porteneuve aka TDD > > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Ah, good idea. I was using firebug, but it used my written code. On 7/12/07, Matt <mattfoster01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''ve run into this problem myself where I thought the P tag would be > containing other elements. I found out what was going on by looking > at the DOM Inspector in Firefox which displayed the element > orientation as it had rendered it, not how I had written it. > > On Jul 12, 9:12 am, "Rob Wilkerson" <r.d.wilker...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Thanks, Christophe. I actually did consider that, but after looking > > at the W3C site, that particular configuration looked valid (p > > elements can contain list elements). Turns out I was looking at the > > XHTML2 spec. Sorry about that. > > > > http://www.w3.org/TR/2003/WD-xhtml2-20030506/mod-block-text.html#s_bl... > > > > On 7/12/07, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > > > > > > > > Hey, > > > > > Rob Wilkerson a écrit : > > > > content is hidden. The nested elements are left visible. Is that > > > > expected? If so, how can I hide everything? What am I missing? > > > > > That''s because your markup is faulty. You can''t nest <ol>''s into <p>, > > > it''s not valid HTML. So the browser actually puts the <ol> outside the > > > <p> from a rendering perspective. Migrate your <p> to a <div> in this > > > instance (and make the "You have two options:" bit its own <p> inside > > > it), then toggle the <div>. That''ll work. > > > > > -- > > > Christophe Porteneuve aka TDD > > > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---