Loading ...
Sorry, an error occurred while loading the content.

Animation question: height versus top

Expand Messages
  • php08691
    If I animate the height attribute of a block element to zero, the other content following it move up the page to fill in the void. If I animate the same
    Message 1 of 4 , Dec 10, 2008
    • 0 Attachment
      If I animate the height attribute of a block element to zero, the
      other content following it move up the page to fill in the void. If I
      animate the same element using the top attribute to move it in the
      negative y direction (up), the content following it stays where it is
      and doesn't fill in the void. How can I animate and move a block
      element in the negative Y direction so that the content following it
      fills in the new void and the page shrinks in height? I can do this
      easily by using the height attribute instead of top, but it's not the
      effect I'm after.
    • Matt Sweeney
      ... Hi, Setting position offsets ( top , left , etc.) will not effect the layout of other elements, but for elements that are statically or relatively
      Message 2 of 4 , Dec 10, 2008
      • 0 Attachment
        php08691 wrote:
        > If I animate the height attribute of a block element to zero, the
        > other content following it move up the page to fill in the void. If I
        > animate the same element using the top attribute to move it in the
        > negative y direction (up), the content following it stays where it is
        > and doesn't fill in the void. How can I animate and move a block
        > element in the negative Y direction so that the content following it
        > fills in the new void and the page shrinks in height? I can do this
        > easily by using the height attribute instead of top, but it's not the
        > effect I'm after.
        >
        >
        >
        Hi,

        Setting position offsets ("top", "left", etc.) will not effect the
        layout of other elements, but for elements that are statically or
        relatively positioned, margins will work.

        For your case, a negative "marginTop" will pull the element and any
        other elements affected by its layout "up".

        - Matt
      • php08691
        ... Thanks Matt, I ll give it a shot.
        Message 3 of 4 , Dec 11, 2008
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, Matt Sweeney <msweeney@...> wrote:
          >
          > php08691 wrote:
          > > If I animate the height attribute of a block element to zero, the
          > > other content following it move up the page to fill in the void. If I
          > > animate the same element using the top attribute to move it in the
          > > negative y direction (up), the content following it stays where it is
          > > and doesn't fill in the void. How can I animate and move a block
          > > element in the negative Y direction so that the content following it
          > > fills in the new void and the page shrinks in height? I can do this
          > > easily by using the height attribute instead of top, but it's not the
          > > effect I'm after.
          > >
          > >
          > >
          > Hi,
          >
          > Setting position offsets ("top", "left", etc.) will not effect the
          > layout of other elements, but for elements that are statically or
          > relatively positioned, margins will work.
          >
          > For your case, a negative "marginTop" will pull the element and any
          > other elements affected by its layout "up".
          >
          > - Matt
          >

          Thanks Matt, I'll give it a shot.
        • php08691
          ... If I ... it is ... not the ... Worked like a charm, thanks.
          Message 4 of 4 , Dec 12, 2008
          • 0 Attachment
            --- In ydn-javascript@yahoogroups.com, "php08691" <jalvich@...> wrote:
            >
            > --- In ydn-javascript@yahoogroups.com, Matt Sweeney <msweeney@> wrote:
            > >
            > > php08691 wrote:
            > > > If I animate the height attribute of a block element to zero, the
            > > > other content following it move up the page to fill in the void.
            If I
            > > > animate the same element using the top attribute to move it in the
            > > > negative y direction (up), the content following it stays where
            it is
            > > > and doesn't fill in the void. How can I animate and move a block
            > > > element in the negative Y direction so that the content following it
            > > > fills in the new void and the page shrinks in height? I can do this
            > > > easily by using the height attribute instead of top, but it's
            not the
            > > > effect I'm after.
            > > >
            > > >
            > > >
            > > Hi,
            > >
            > > Setting position offsets ("top", "left", etc.) will not effect the
            > > layout of other elements, but for elements that are statically or
            > > relatively positioned, margins will work.
            > >
            > > For your case, a negative "marginTop" will pull the element and any
            > > other elements affected by its layout "up".
            > >
            > > - Matt
            > >
            >
            > Thanks Matt, I'll give it a shot.
            >
            Worked like a charm, thanks.
          Your message has been successfully submitted and would be delivered to recipients shortly.