Hi guys, is it possible through prototype knowing if an element is hidden? Something like $(''my_id'').hidden == true Thanks and have a nice day --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Depends on how it''s hidden, but for the most part you can say: if ($(...).visible()) { ... } On Fri, Jun 6, 2008 at 1:03 PM, macsig <sigbackup-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi guys, > is it possible through prototype knowing if an element is hidden? > > Something like $(''my_id'').hidden == true > > Thanks and have a nice day-- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Fri, Jun 6, 2008 at 1:14 PM, Frederick Polgardy <fred-SMQUYeM9IBBWk0Htik3J/w@public.gmane.org> wrote:> Depends on how it''s hidden, but for the most part you can say: > > if ($(...).visible()) { ... }I think he means where the type=hidden, in which the above would still evaluate to true. You can just say: myElement.type == ''hidden'' Or better yet, just extend Form.Element and add a isHidden() method or something like that. -justin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Fri, Jun 6, 2008 at 1:28 PM, Justin Perkins <justinperkins-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On Fri, Jun 6, 2008 at 1:14 PM, Frederick Polgardy <fred-SMQUYeM9IBBWk0Htik3J/w@public.gmane.org> > wrote: > > Depends on how it''s hidden, but for the most part you can say: > > > > if ($(...).visible()) { ... } > > I think he means where the type=hidden, in which the above would still > evaluate to true. >Well visible() just boils down to a check to see that element.style.display != ''hidden''. If it''s hidden by setting style.visibility to hidden, it won''t work, you''ll have to check that yourself. -- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Fri, Jun 6, 2008 at 1:33 PM, Frederick Polgardy <fred-SMQUYeM9IBBWk0Htik3J/w@public.gmane.org> wrote:> Well visible() just boils down to a check to see that element.style.display > != ''hidden''. > > If it''s hidden by setting style.visibility to hidden, it won''t work, you''ll > have to check that yourself.Man I really misread his original question! I read it as relating to an input control of type=hidden. Good thing it''s friday :p -justin --~--~---------~--~----~------------~-------~--~----~ 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 wasn''t 100% sure either, I just read it a few times and assumed element meant an actual DOM element. :-) On Fri, Jun 6, 2008 at 1:38 PM, Justin Perkins <justinperkins-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Man I really misread his original question! > > I read it as relating to an input control of type=hidden. Good thing > it''s friday :p-- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---