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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:46:07+00:00 2026-05-27T21:46:07+00:00

When i press ‘Click me’ the pop up div infobox appears. The bg div,

  • 0

When i press ‘Click me’ the pop up div infobox appears. The bg div, which is behind the infobox div should cover 100% of the page, what is happening is it is only covering 100% of the window. How do i solve this? Here is the jsfiddle http://jsfiddle.net/mdanz/wWLVr/2/

   <html>
<head>
<style type="text/css">
#infobox {
position:absolute; width:100px; height:150px; top:100px; left:50%; z-index:2; margin-left:-50px; display:none; border:1px solid black; background-color:#FFFFFF;
}
#bg {
position:absolute; background-color:#000000; opacity:0.4;  filter:alpha(opacity=40); top:0; left:0; width:100%; display:none; min-height:100%; z-index:1;
}

.displaybox {
display:block; border:1px solid black; background-color:green; width:200px; height:200px;
}
#infobutton {
border:1px solid black; width:100px; padding:5px; display:block; cursor:pointer;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('#infobutton').click(function() {

    $('#bg').show();
    $('#infobox').show();
    $('html, body').animate({ scrollTop: 0 }, 0);
    });
    });
</script>
</head>
<body>
<div id='infobutton'>Click Me</div>
<div id='bg'></div>
<div id='infobox'></div>
<div class='displaybox'></div>
<div class='displaybox'></div>
<div class='displaybox'></div>
<div class='displaybox'></div>
<div class='displaybox'></div>
<div class='displaybox'></div>
   </body>

</html>
  • 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-27T21:46:07+00:00Added an answer on May 27, 2026 at 9:46 pm

    You can add :

    $('#bg').css("height", $("body").css("height"));
    

    just before showing this element…

    You can have a look at this fiddle : http://jsfiddle.net/scaillerie/uWeJf/

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

Sidebar

Related Questions

I press button after that appears div in which shows loading and loads iframe.
Whenever you press the tab key while on a web page, the browser puts
When I press F5 the project compiles, and the new web page launches. However,
When I press Ctrl+ in a modern browser, the page zooms, including images; a
Possible Duplicate: UIButton long press with finger stationary I have created 100 buttons from
In the word press admin panel there is a category selection 'helper panel' which
I am trying to press tab and enter key through javascript/jquery on page load.
When i press a button an overlay appears. In Firefox the overlay is fast,
When I press 'View source code' of a certain web page, it's kind of
When I press Ctrl+F, the Find dialog appears in adventurous positions. When more than

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.