Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>just to post the complete solution to my specific problem in case this may help others, here is the code:</p> <p>JS:</p> <pre><code>$('your_trigger').click(function(event) { // click on the button to trigger animation event.preventDefault(); // stop click // animate function resizer () { // run inside a function to execute all animations at the same time $('your_container').animate({marginTop: 0, height:99}, 400, function() { $('#newsletter_form').show(300); // this is just my content fading in }); // this is the footer container (inside is your_container) // &amp; div.push (sticky footer component) $('footer,.push').animate({marginTop:0}, 400); }; resizer(); // run }); </code></pre> <p>CSS: (<a href="http://ryanfait.com/resources/footer-stick-to-bottom-of-page/" rel="nofollow noreferrer">this is the sticky footer i am using</a>)</p> <pre><code>/* ================= */ /* = STICKY FOOTER = */ /* ================= */ html, body { height: 100%; } #wrap { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -135px; /* -full expanded height of the footer */ position: relative; } footer, .push { height: 101px; /* height of this is equal to the collapsed elements height */ clear: both; } section#newsletter,footer { margin-top: 34px; /* this is the difference between the expanded and the collapsed height */ } </code></pre> <p>So basically I am positioning my <code>footer</code> as I would normally with the full height of the TOTAL (after animation height) and then I push down the initial content via margin-top to compensate for the lesser value in height when the <code>your_container</code> is collapsed.</p> <p>Then on animate both the height of <code>your_container</code> is adjusted and the margin-top on <code>your_container</code> and <code>footer</code> &amp; <code>.push</code> are removed.</p> <p>Hope this helps someone else when they stumble upon this.</p> <p>J.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload