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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:36:45+00:00 2026-05-28T04:36:45+00:00

So I have a hidden div that shows itself on $(document).ready() displaying a form

  • 0

So I have a hidden div that shows itself on $(document).ready() displaying a form to either log in or sign up. I’m trying to get the screen suppressed look as when a traditional Javascript alert is shown. I’m in testing phase and just using a class that sets opacity to the body but it’s also applying to the pop-up div. I’m trying to just set opacity to the everything behind it. Here is what I have.

$("body").not("#overlay").addClass("suppress");

I’ve tried several other variations to exclude that div but I’m not sure it it’s possible since I’m applying to the body. Do you have and suggestions to lead me in the right direction?

  • 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-28T04:36:46+00:00Added an answer on May 28, 2026 at 4:36 am

    You should set the #overlay div to the following:

    #overlay {
         width: 100%;
         height: 100%;
         position:fixed;
         z-index: 1000;
         background: rgba(255, 255, 255, 0.7)
    }
    

    The semi-transparent white background overlay will have the same effect as lowering the opacity of the body. Alternatively you could use a 1px by 1px semi-transparent .png background image instead of rgba.

    Then you can use another div inside of #overlay which will center the form:

    #overlay .inner {
         width: 200px;
         height: 200px;
         position: absolute;
         top: 50%;
         left: 50%;
         margin: -100px 0 0 -100px
    }
    

    That way you don’t have to worry about altering the css of any other element.


    To comment on the approach you mentioned in your answer:

    It’s my understanding that your current code is saying “find any body element that does not have the id ‘overlay’ and add the class ‘suppress'”… in other words, not() only applies to the set of matched elements. If what you want is to change the opacity of all elements except #overlay, you could do the following:

    <body>
         <div id="overlay">
              overlay stuff in here
         </div>
    
         <div id="other-content">
              All page content in here
         </div>
    </body>
    
    
    $(document).ready(function(){
         $('#other-content').addClass('suppress');  
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that shows hidden text when you hover over a div.
I have a funciton that I am currently using to show a hidden div.a_type
I have an animation on a partially hidden div container that will execute when
I have a bunch of images that are in a hidden div. The div
I basically have a div with set dimensions and overflow: hidden . That div
I have a situation that i have a hidden div with two input elements
I have a div that is being used an a email newsletter signup form.
I have two simple scripts, the first shows a div when clicked. Inside that
I have a checkbox that shows/hides a div that contains a grid of radio
I have two dropdown hidden menus ie menu A and menu B that shows

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.