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 6348919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:30:51+00:00 2026-05-24T21:30:51+00:00

I am building a menu in jQuery using .animate() but I’ve run into a

  • 0

I am building a menu in jQuery using .animate() but I’ve run into a problem. I have a div that initially loads with position:fixed and bottom:30px. Upon click of a link, I want my div to move to the height position of that link. Essentially, I have this:

http://jsfiddle.net/wRjyK/32/

The problem is that the first animation initially moves from off of the top of the screen in a downward motion. (Because it doesn’t have a top property) I want the animation to start with its current position. When I repeat the animation with other links, it looks fine because my div now has the proper top property to work off of.

A simple fix would be to change the css of my div to have a top property, but my design requires the bottom property. Any ideas?

  • 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-24T21:30:52+00:00Added an answer on May 24, 2026 at 9:30 pm

    There are a few keys to making this work. Here’s a jsFiddle example.

    $('a').click(function(){
        var offsetTop = $(this).offset().top;
        var footerOffsetTop = $('.footer').offset().top;
        $('.footer').css({position:'absolute',bottom:'',top:footerOffsetTop})
            .animate({top:offsetTop},500);
    });
    

    It essentially works like this:

    1. Find the footer’s offset().top value
    2. Change the footer’s CSS so that it is absolutely positioned with the
      top: property having the value found in #1. This keeps allows you to
      animate it’s top property, without having it jump.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a context menu component using jQuery that essentially builds a div programmatically
I am building a menu using XHTML,CSS, and jQuery and I ran into a
I'm building a navigation system using jquery scrollto. I have my navigation menu in
I am building a html menu and I am using jQuery UI to format
I have this annoying problem with padding. I am building a menu, here is
I am building a site that uses two jquery plugins: A Jquery Menu (that
again. I have a menu that I'm building. Everything works fine, except for the
I am building menu with jquery, and I have set active class to selected
I'm going to be building a CSS menu bar into a site much like
I’m building an application where different users will have different menu items available to

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.