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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:05:28+00:00 2026-06-14T22:05:28+00:00

Possible Duplicate: Div as modal – javascript Is there a way to somehow lock

  • 0

Possible Duplicate:
Div as modal – javascript

Is there a way to somehow lock a page in Javascript until a function call is complete? What I have in mind is like a semi-transparent grey cover that prevents any other user actions such as mouse-overs or button clicks until the current request is done processing. The look-and-feel doesn’t matter quite as much as the functionality, though.

I haven’t been able to find anything that does this. Most “solutions” to this problem simply say to wait to load the other HTML elements until you’re done with whatever processing you’re performing, but in this particular circumstance, all the options are already present on the screen. I want to be able to prevent the user from performing another action from the page until the current request is complete.

  • 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-14T22:05:29+00:00Added an answer on June 14, 2026 at 10:05 pm

    I tend to use a simple div and some javascript to do this sort of thing.

    So for example, in your page create a div, which will function as your grey-out.

          <div id="blackout" style='background-image:url(someSemiTransparent.png); display:none;"></div>
    

    Then style it like so:

          #blackout {
          width:100%;
          height:100%; /* make sure you have set parents to a height of 100% too*/
          position: absolute;
          left:0; top:0;
          z-index:10 /*just to make sure its on top*/}
    

    Then when your process is about to begin you can call (to show it):

          document.getElementById('blackout').style.display = 'block';
    

    And once its done you can hide it again by:

          document.getElementById('blackout').style.display = 'none';
    

    When you do show it, you may want to set the overflow of your body to hidden, then back to auto too, this will prevent the user scrolling and only seeing partial blackout.

    Now I normally use jquery for the show and hide though am pretty sure the javascript above is correct..

    Update:

    To keep everything much tidier, as Chad mentions, you’re better off putting all styling into CSS. I.E.

      #blackout {
         width:100%;
         height:100%; /* make sure you have set parents to a height of 100% too*/
         position: absolute;
         left:0; top:0;
         z-index:10 /*just to make sure its on top*/
         background-image:url(someSemiTransparent.png); 
         display:none;}
    

    and remove the style from the DIV. I.E

          <div id="blackout"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: JavaScript library to create div-style window within page I would like to
Possible Duplicate: Div Z-Index issue with Flash movie Okay, is there a way to
Possible Duplicate: Select div with specific width Is there a way to select all
Possible Duplicate: Javascript callback when IFRAME is finished loading? Is there any way to
Possible Duplicate: how to display jquery page(inside a div) using javascript? here is my
Possible Duplicate: Is there a way to make a DIV unselectable? I have seen
Possible Duplicate: How to align a <div> to the middle of the page I
Possible Duplicate: JavaScript: Scroll Position of div with “overflow: auto” Hi, i want to
Possible Duplicate: How to horizontally center a div? One simple way to make an
Possible Duplicate: Change an element's CSS class with JavaScript I'm trying to set div's

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.