Hi. I have a div, where i load some external content with ajax, Im therefore trying to make the div resize to accomodate the new coontent. I want it to resize, a bit like Effect.Scale, but without the content scaling, so that it is only the height/width of the container div that is changed. therefore Effect.Scale won''t work. I can get the new size it needs to resize, and could ofcourse just use setStyle(), but i want it to be a animated resize, like Effect.Scale has. How can this be done? the way it is done, I have 2 div''s. where the second is nested in the first one. <div id="container" ><div id="content" ></div></div>. I load the content into the inner div (content), and measure its size after it has been loaded, to get the new size. I would then like the outer div (container) to scale to the new height and width. --~--~---------~--~----~------------~-------~--~----~ 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 thought there was also something like Effect.Morph(); ( http://script.aculo.us/docs/Effect.Morph.html ) You just pass it a few css-rules (in your case width/height) and it animates those. Greetz, Wizz On Apr 24, 10:14 am, revivedk <Timsoren...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi. > > I have a div, where i load some external content with ajax, Im > therefore trying to make the div resize to accomodate the new > coontent. > > I want it to resize, a bit like Effect.Scale, but without the content > scaling, so that it is only the height/width of the container div that > is changed. therefore Effect.Scale won''t work. > I can get the new size it needs to resize, and could ofcourse just use > setStyle(), but i want it to be a animated resize, like Effect.Scale > has. > > How can this be done? > > the way it is done, I have 2 div''s. where the second is nested in the > first one. <div id="container" ><div id="content" ></div></div>. > I load the content into the inner div (content), and measure its size > after it has been loaded, to get the new size. I would then like the > outer div (container) to scale to the new height and width.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
with scripty you can use the effects as an extension of the elements as well. mydiv.morph(...) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thank you, that did exactly what I wanted it to. but, my problem now is that I want to run a function, AFTER the morph. since i need to resize another element when the new one has completed. On 24 Apr., 12:30, Wizz <woutaw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I thought there was also something like Effect.Morph(); (http://script.aculo.us/docs/Effect.Morph.html) > > You just pass it a few css-rules (in your case width/height) and it > animates those. > > Greetz, > > Wizz > > On Apr 24, 10:14 am, revivedk <Timsoren...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi. > > > I have a div, where i load some external content with ajax, Im > > therefore trying to make the div resize to accomodate the new > > coontent. > > > I want it to resize, a bit like Effect.Scale, but without the content > > scaling, so that it is only the height/width of the container div that > > is changed. therefore Effect.Scale won''t work. > > I can get the new size it needs to resize, and could ofcourse just use > > setStyle(), but i want it to be a animated resize, like Effect.Scale > > has. > > > How can this be done? > > > the way it is done, I have 2 div''s. where the second is nested in the > > first one. <div id="container" ><div id="content" ></div></div>. > > I load the content into the inner div (content), and measure its size > > after it has been loaded, to get the new size. I would then like the > > outer div (container) to scale to the new height and width.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You can add an afterFinish callback.
see: http://script.aculo.us/docs/CoreEffects.html
afterFinish: function(){ do something }
On Apr 25, 3:27 am, revivedk
<Timsoren...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Thank you, that did exactly what I wanted it to.
>
> but, my problem now is that I want to run a function, AFTER the morph.
> since i need to resize another element when the new one has completed.
>
> On 24 Apr., 12:30, Wizz
<woutaw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > I thought there was also something like Effect.Morph();
(http://script.aculo.us/docs/Effect.Morph.html)
>
> > You just pass it a few css-rules (in your case width/height) and it
> > animates those.
>
> > Greetz,
>
> > Wizz
>
> > On Apr 24, 10:14 am, revivedk
<Timsoren...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > Hi.
>
> > > I have a div, where i load some external content with ajax, Im
> > > therefore trying to make the div resize to accomodate the new
> > > coontent.
>
> > > I want it to resize, a bit like Effect.Scale, but without the
content
> > > scaling, so that it is only the height/width of the container div
that
> > > is changed. therefore Effect.Scale won''t work.
> > > I can get the new size it needs to resize, and could ofcourse
just use
> > > setStyle(), but i want it to be a animated resize, like
Effect.Scale
> > > has.
>
> > > How can this be done?
>
> > > the way it is done, I have 2 div''s. where the second is
nested in the
> > > first one. <div id="container" ><div
id="content" ></div></div>.
> > > I load the content into the inner div (content), and measure its
size
> > > after it has been loaded, to get the new size. I would then like
the
> > > outer div (container) to scale to the new height and width.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---