Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 681221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:27:35+00:00 2026-05-14T01:27:35+00:00

I have a simple problem but I am not sure how to solve it.

  • 0

I have a simple problem but I am not sure how to solve it.

Basically I have some hidden content that, once expanded, requires a height of 99px. While collapsed the element holding it section#newsletter is set to be 65px in height.

LIVE EXAMPLE: http://dev.supply.net.nz/asap-finance-static/

On the click of a#signup_form the section#newsletter is expanded to 99px using the following jQuery:

$('#newsletter_form').hide(); // hide the initial form fields
$('#form_signup').click(function(event) {
    event.preventDefault(); // stop click
    // animate
    $('section#newsletter').animate({height: 99}, 400, function() {
        $('#newsletter_form').show(300);
    })
});

All this works great except for the fact that this element sits in a sticky footer so its initial height is used to position it.

Animating the height of this element causes scrollbars on the browser, because the 34px added are added to the bottom of the element, so my question:

How can I add these 34px to the top of the element so the height expands upwards into the body not downwards?

Thanks for reading,
I look forward to your help and suggestions.

Jannis

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:27:35+00:00Added an answer on May 14, 2026 at 1:27 am

    just to post the complete solution to my specific problem in case this may help others, here is the code:

    JS:

    $('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) 
            // & div.push (sticky footer component)
            $('footer,.push').animate({marginTop:0}, 400);
        };
        resizer(); // run
    });
    

    CSS: (this is the sticky footer i am using)

    /* ================= */
    /* = 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 */
    }
    

    So basically I am positioning my footer 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 your_container is collapsed.

    Then on animate both the height of your_container is adjusted and the margin-top on your_container and footer & .push are removed.

    Hope this helps someone else when they stumble upon this.

    J.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple problem but I don't know how to solve it because
I have a very simple problem, but I can't seem to solve it. I
I have a very simple problem and a solution that will work, but I'm
I have a simple problem but no matter what I try I can't see
Hi I am new to PHP and have a simple problem but I have
I have a very simple problem but cannot find a nice solution. I have
Newbie Warning I have a simple but vexing problem trying to disable an NSButton.
I have a seemingly simple problem, but I can't quite figure out a solution.
a possibly simple problem, but weird why I have no idea how to do
I have what I though was a simple problem to solve (never is!) I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.