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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:34:57+00:00 2026-05-26T23:34:57+00:00

To be precise, you guys may have noticed that facebook has this component placed

  • 0

To be precise, you guys may have noticed that facebook has this component placed on the right-most column, this is how it would look when the browser window is maximized:
facebook frame (maximized window)

Now, If I resize my browser window to an smaller size, this is how it looks:
facebook frame(resized)

As you can see, as the overflowing container re-sizes(because of browser-window re-size), the grip(circled in red) is re-sized too. This to allow scrolling down to the bottom element inside the over-flowing container

I have created a similar component using jQuery-Ui:

My frame with scroll(maximized)

But my problem is that I haven’t been able to calculate the NEW grip size for when the container is resized:

My frame with scroll(resized)

Here you can see that I’m almost there, but the grip should indeed be smaller to allow scrolling to the bottom (like the Facebook one).

My Question is, What formula do you suggest using to accomplish this?

Here’s what I’ve been trying so far:

function calculate_grip_size() {
  h = (parseFloat($('#box-container').css('height')) / parseFloat($('#box').css('height'))) * 100;
  $('#grip').css('height', h);
}

and the corresponding HTML for it:

<div id="box-container">
  <div id="area-track">
    <div id="grip">
    </div>
  </div>
  <div id="box">
    <div class="ipsum">
      Lorem ipsum...
    </div>
    <div class="ipsum">
      Lorem ipsum...
    </div>
    <div class="ipsum">
      Lorem ipsum...
    </div>
    <div class="ipsum">
      Lorem ipsum... 
    </div>
    <div class="ipsum">
      Lorem ipsum... 
    </div>
    <div class="ipsum">
      Lorem ipsum 
    </div> 
  </div>
</div>
  • 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-26T23:34:58+00:00Added an answer on May 26, 2026 at 11:34 pm

    I was checking out this plugin called slimScroll earlier and the author uses this method – translated to match your selectors (I think); although it would be better to generalize the selectors by using class names instead of IDs:

    var minH = 50,
        h = Math.max( $('#box-container').outerHeight() / parseInt($('#box').prop('scrollHeight'),10) * 100, minH );
    $('#grip').height(h);
    

    Update: Oops, bad math and forgot to parse the scrollHeight value. Try it now.

    Update #2: Ok, I think I found the problem… well two problems.

    1. The above calculation didn’t take into account that the grip was inside of the area-track which isn’t the same height as the box-container

      $('#grip').height($('#area-track').height() * h);
      
    2. The content was being positioned as a 1:1 ratio with the grip, so it needed to be divided by the content ratio

      increment = parseInt(ui.helper.css('top')) / -h;
      

    And here is a demo I made using the code you shared.

    Oh, and I had to add padding-bottom: 25px; to the #box css definition so the whole ipsum box was visible – adjust as needed because it depends on how much padding is there.

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

Sidebar

Related Questions

I'm painting this object in C# using GDI and I need to have precise
I precise that I restrict this question to native development for my x86 (64bits)
I have a python application , to be more precise a Network Application that
I have a very precise question: I want to make an android application that
I have a sorted set (std::set to be precise) that contains elements with an
I have several textboxes, 6 to be precise. What I want is that whenever
I'm interested in finding the most precise decimal values in a database field. I'd
XmlElement has an Order attribute which you can use to specify the precise order
I want to use precise layout on Nexus One, my code is like this:
I Have a JTable (or a JXTable to be more precise) with 3 sections

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.