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
  • 0 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

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • added an answer Well, start off by thinking of which bits of data… May 17, 2026 at 9:17 am
  • added an answer For this task it is a good idea to use… May 17, 2026 at 9:15 am
  • added an answer This is exactly how the Skyhook database (built into many… May 17, 2026 at 9:15 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a very simple problem and a solution that will work, but I'm
i have very simple problem. I need to create model, that represent element of
I have a very simple problem which requires a very quick and simple solution
I have a simple, real life problem I want to solve using an OO
I'm not sure if this is even possible, but here goes: I have a
I have a simple problem when querying the SQL Server 2005 database. I have
I have a seemingly simple problem though i am unable to get my head
I have a fairly simple sync problem. I have a table with about 10
Seems like a simple problem: I have an SVN repo inside our firewall. I
Ok, simple problem hopefully. I have started to make a simple server for a

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.