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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:23:16+00:00 2026-06-03T03:23:16+00:00

I am creating a page similar to Pinterest where items flow vertically as the

  • 0

I am creating a page similar to Pinterest where items flow vertically as the user scrolls. When the user clicks on one of these items, a modal with related content opens. Currently, the modal is an absolutely-positioned div.

Both the modal and the background (item list) are longer than the user’s browser height. How can I make the scroll bar on the browser represent the modal div’s height and not the background’s height, and then set it back when the modal is closed?

I tried hiding the background and showing the modal, but then when I hide the modal and show the background it scrolls the page all the way back up again. I’d like to keep the background slightly visible, like on Pinterest’s main page.

  • 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-03T03:23:19+00:00Added an answer on June 3, 2026 at 3:23 am

    I would do something like this for the modal div:

    <div style="background-color: rgba(255,255,255, 0.93);position:fixed;
    overflow-x:auto;overflow-y:scroll;bottom:0;left:0;right:0;top:0;
    z-index:9999;"></div>
    

    It creates a div that fills the whole document and then adds the scrollbar for the middle content. As soon as you show the modal you need to set the main body (the background) of your page to:

    style="overflow:hidden"
    

    You could use jquery like:

    $("body").css("overflow", "hidden");
    

    It is important to get the main body to set the overflow to hidden in order to remove the other scroll bar. When I tested this in Firefox, it worked. I had a div as described and then set the body style and it worked. I was also in the middle of the document when I tested it. The background document stayed where it was and didn’t move.

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

Sidebar

Related Questions

I am creating a page that has several user controls (similar to WebParts). Each
I am creating a page where people can post articles. When the user posts
I want after login user redirects to page creating new table(website), so I have
I'm creating a web page of interviews, where the user can answer a specific
I am looking at creating a page that the user can move around as
I am interested in creating a web page editor like the one used in
Here i need the grid layout for creating similar to the photo album page,But
I have created a custom content type and using views2 for creating various page-views.
I am creating a user login system similar to a client intranat. And when
I am creating a page where I can list all of my jobs, both

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.