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

  • Home
  • SEARCH
  • 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 7797079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:34:09+00:00 2026-06-01T23:34:09+00:00

This could be really obvious and I’m completely missing it. I’ve searched for hours

  • 0

This could be really obvious and I’m completely missing it.

I’ve searched for hours and can’t seem to find a way to, using jQuery, reveal a hidden div from the bottom up. What I am trying to achieve is exactly as in the following link, but in reverse: http://jqueryui.com/demos/show/

I can slide a div from the bottom to the top, but this reveals itself as it moves, rather than being ‘masked’ in.

Like I said, this could (should?) be really obvious and I’m not seeing it, but I’ve been looking for ages and can’t find a solution to this relatively simple problem.

Thanks,

Ronnie

  • 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-06-01T23:34:12+00:00Added an answer on June 1, 2026 at 11:34 pm

    The effect you’re looking for is a little tricky to achieve, but it can be done, even without a wrapper element.

    The main issue here is that elements naturally render top-down, not bottom-up. Animating both the top and height CSS properties of a relatively-positioned element allows us to implement a slide-up effect, but the element will still render top-down:

    +-------------------------------------------+
    |                                           |  ^
    |                                           |  |  Hidden area collapses upwards.
    |                                           |  |
    +-------------------------------------------+ <-- 'top'
    |                                           |  ^
    |  |  Upper part of element (visible).      |  |  
    |  |                                        |  |  Animation goes bottom-up.
    |  |  Element still renders top-down.       |  |  
    |  |                                        |  |
    +--|----------------------------------------+ <-- 'top + height' 
    |  |                                        |  |
    |  |  Lower part of element (hidden).       |  |
    |  V                                        |  |
    +-------------------------------------------+
    

    If we want to simulate bottom-up rendering, we have to modify the scrollTop property of the element during the animation, in order for its lower part to always remain in view:

    +-------------------------------------------+
    |                                           |  ^
    |  |  Upper part of element (hidden).       |  |  Hidden area collapses upwards.
    |  |                                        |  |
    +--|----------------------------------------+ <-- 'top' and 'scrollTop'
    |  |                                        |  ^
    |  |  Element still renders top-down.       |  |  
    |  |                                        |  |  Animation goes bottom-up.
    |  |  Lower part of element (visible).      |  |  
    |  V                                        |  |
    +-------------------------------------------+ <-- 'top + height' 
    

    We can use animate() with scrollTop, but doing so in conjunction with top and height did not work correctly in my tests (I suspect scrollTop is reset when top or height are modified in the first animation step, so it ends up stuck to 0).

    To work around this, we can handle scrollTop ourselves through the optional step function we can pass to animate(). This function is called with two arguments, now and fx, now being the current value of the animated property and fx being a wrapper object around useful information, like the element and property being animated.

    Since we always want scrollTop to be the same as top, we only have to test if top is being animated in our step function. If it is, we set scrollTop to now. This solution gives acceptable results, although it flickers a little too much for my taste (that might be an artifact of my browser, though).

    So, in summary, to implement that effect, we have to:

    • Fetch the element’s original height,
    • Make the element position: relative; so we can animate its top property,
    • Collapse the element by setting top to the original height and height to 0,
    • Show the element (necessary in your fiddle since display: none; is applied),
    • Animate top to 0 and height to the original height,
    • Give scrollTop the value of top on each animation step.

    Resulting in the following code:

    $("#click").click(function() {
        var $revealMe = $("#revealMe");
        var originalHeight = $revealMe.height();
        $revealMe.css({
            position: "relative",
            top: originalHeight,
            height: 0
        }).show().animate({
            top: 0,
            height: originalHeight
        }, {
            duration: 1000,
            step: function(now, fx) {
                if (fx.prop == "top") {
                    $(fx.elem).scrollTop(now);
                }
            }
        });
    });
    

    You can test it in this fiddle.

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

Sidebar

Related Questions

I could really use an example of this. Can anyone provide me with a
I've been fighting this problem for many hours now and could really use some
This could be really easy but I it's not obvious when I google it.
I'm quite sure I'm missing some sort of really obvious solution to this. It
This seems to be an overlooked area that could really use some insight. What
This is a C# question, but really could be language-agnostic I have inherited a
This sounds really stupid, but I was told that you could drag-and-drop visual components
I would really appreciate if you could shed light on this problem. I have
Probably really easy for a pro, but could someone re-write this from it's PHP
I couldn't really find this in Rails documentation but it seems like 'mattr_accessor' is

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.