Laurie Harper
2005-Sep-14 05:38 UTC
[Rails-spinoffs] Effects.Scale and form input elements
is it possible to use Effects.Scale to make a set of form input elements appear in a ''slide out'' effect? I''m trying to build a control with a button which, when clicked, will cause a row of form inputs to appear. I can do this with Effects.Appear, but what I really wanted was for the inputs to appear to ''slide out'' from the button. What I want to end up with would look something like [Button] [select 1 |v] [select 2 |v] [text box...] So, I wrapped the two selects and the text input all in a span and called Effects.Scale on the enclosing span. Unfortunately, this doesn''t seem to work, whatever options I pass to the effect. I can scale individual form controls, but not a group wrapped in a span. Even with scaleContent set to true, the form controls don''t scale. Any hints? Following is sample code for what I''m trying: L. <input type="button" value="Select Locale" onclick="foo (''UiLocaleSelect'')"/> <span id="UiLocaleSelect" style="display: none"> <select id="language"> <option>[Language]</option> ... </select> <select id="country"> <option>[Country]</option> ... </select> <input id="variant" type="text" value="[Variant]"/> </span> <script> new Effect.Scale($(''UiLocaleSelect''), 100, { scaleContent: true, scaleY: false, scaleX: true, scaleFrom: 0}); </script> -- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.com/
Andrew Kaspick
2005-Sep-14 07:56 UTC
[Rails-spinoffs] Effects.Scale and form input elements
The effects only work on block elements I believe, so try a div instead. Somebody correct me if I''m wrong. On 9/14/05, Laurie Harper <laurie@holoweb.net> wrote:> is it possible to use Effects.Scale to make a set of form input > elements appear in a ''slide out'' effect? I''m trying to build a > control with a button which, when clicked, will cause a row of form > inputs to appear. I can do this with Effects.Appear, but what I > really wanted was for the inputs to appear to ''slide out'' from the > button. > > What I want to end up with would look something like > > [Button] [select 1 |v] [select 2 |v] [text box...] > > So, I wrapped the two selects and the text input all in a span and > called Effects.Scale on the enclosing span. Unfortunately, this > doesn''t seem to work, whatever options I pass to the effect. I can > scale individual form controls, but not a group wrapped in a span. > Even with scaleContent set to true, the form controls don''t scale. > > Any hints? Following is sample code for what I''m trying: > > L. > > <input type="button" value="Select Locale" onclick="foo > (''UiLocaleSelect'')"/> > <span id="UiLocaleSelect" style="display: none"> > <select id="language"> > <option>[Language]</option> > ... > </select> > <select id="country"> > <option>[Country]</option> > ... > </select> > <input id="variant" type="text" value="[Variant]"/> > </span> > <script> > new Effect.Scale($(''UiLocaleSelect''), 100, { > scaleContent: true, > scaleY: false, > scaleX: true, > scaleFrom: 0}); > </script> > > -- > Laurie Harper > Open Source advocate, Java geek: http://www.holoweb.net/laurie > Founder, Zotech Software: http://www.zotechsoftware.com/ > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Whitcraft, Jon
2005-Sep-14 10:24 UTC
[Rails-spinoffs] Effects.Scale and form input elements
Yes you are correct. Jon -----Original Message----- From: rails-spinoffs-bounces@lists.rubyonrails.org [mailto:rails-spinoffs-bounces@lists.rubyonrails.org] On Behalf Of Andrew Kaspick Sent: Wednesday, September 14, 2005 7:05 AM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Effects.Scale and form input elements The effects only work on block elements I believe, so try a div instead. Somebody correct me if I''m wrong. On 9/14/05, Laurie Harper <laurie@holoweb.net> wrote:> is it possible to use Effects.Scale to make a set of form input > elements appear in a ''slide out'' effect? I''m trying to build a > control with a button which, when clicked, will cause a row of form > inputs to appear. I can do this with Effects.Appear, but what I > really wanted was for the inputs to appear to ''slide out'' from the > button. > > What I want to end up with would look something like > > [Button] [select 1 |v] [select 2 |v] [text box...] > > So, I wrapped the two selects and the text input all in a span and > called Effects.Scale on the enclosing span. Unfortunately, this > doesn''t seem to work, whatever options I pass to the effect. I can > scale individual form controls, but not a group wrapped in a span. > Even with scaleContent set to true, the form controls don''t scale. > > Any hints? Following is sample code for what I''m trying: > > L. > > <input type="button" value="Select Locale" onclick="foo > (''UiLocaleSelect'')"/> > <span id="UiLocaleSelect" style="display: none"> > <select id="language"> > <option>[Language]</option> > ... > </select> > <select id="country"> > <option>[Country]</option> > ... > </select> > <input id="variant" type="text" value="[Variant]"/> > </span> > <script> > new Effect.Scale($(''UiLocaleSelect''), 100, { > scaleContent: true, > scaleY: false, > scaleX: true, > scaleFrom: 0}); > </script> > > -- > Laurie Harper > Open Source advocate, Java geek: http://www.holoweb.net/laurie > Founder, Zotech Software: http://www.zotechsoftware.com/ > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Laurie Harper
2005-Sep-14 10:49 UTC
[Rails-spinoffs] Effects.Scale and form input elements
Really? I experimented with a span containing just text and everything seemed to work... Also, I tried using a div around my form controls, but no joy there either. L. On 14-Sep-05, at 10:31 AM, Whitcraft, Jon wrote:> Yes you are correct. > > Jon > > -----Original Message----- > From: rails-spinoffs-bounces@lists.rubyonrails.org > [mailto:rails-spinoffs-bounces@lists.rubyonrails.org] On Behalf Of > Andrew Kaspick > Sent: Wednesday, September 14, 2005 7:05 AM > To: rails-spinoffs@lists.rubyonrails.org > Subject: Re: [Rails-spinoffs] Effects.Scale and form input elements > > The effects only work on block elements I believe, so try a div > instead. > > Somebody correct me if I''m wrong. > > On 9/14/05, Laurie Harper <laurie@holoweb.net> wrote: > >> is it possible to use Effects.Scale to make a set of form input >> elements appear in a ''slide out'' effect? I''m trying to build a >> control with a button which, when clicked, will cause a row of form >> inputs to appear. I can do this with Effects.Appear, but what I >> really wanted was for the inputs to appear to ''slide out'' from the >> button. >> >> What I want to end up with would look something like >> >> [Button] [select 1 |v] [select 2 |v] [text box...] >> >> So, I wrapped the two selects and the text input all in a span and >> called Effects.Scale on the enclosing span. Unfortunately, this >> doesn''t seem to work, whatever options I pass to the effect. I can >> scale individual form controls, but not a group wrapped in a span. >> Even with scaleContent set to true, the form controls don''t scale. >> >> Any hints? Following is sample code for what I''m trying: >> >> L. >> >> <input type="button" value="Select Locale" onclick="foo >> (''UiLocaleSelect'')"/> >> <span id="UiLocaleSelect" style="display: none"> >> <select id="language"> >> <option>[Language]</option> >> ... >> </select> >> <select id="country"> >> <option>[Country]</option> >> ... >> </select> >> <input id="variant" type="text" value="[Variant]"/> >> </span> >> <script> >> new Effect.Scale($(''UiLocaleSelect''), 100, { >> scaleContent: true, >> scaleY: false, >> scaleX: true, >> scaleFrom: 0}); >> </script> >> >> -- >> Laurie Harper >> Open Source advocate, Java geek: http://www.holoweb.net/laurie >> Founder, Zotech Software: http://www.zotechsoftware.com/ >> >> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.com/