Display Details like lightBox

Display Details like lightBox

Dear Sir/Madam

pls refer


Green button
  Reminder List

we get popup and small div inside
This part is working the way I want 

however when we scroll down the dark background and the pop div also get scrolled.
I want their position fixed


html
  1. <!--- DIV with dark back ground -->
  2. <div class="popbg" id="mainbgdiv" >

  3. </div>
  4. <!--- DIV with Data  -->
  5. <div class="popdata" id="insidediv">

  6. </div>


css

  1. /*--------------------Center DIV--------------*/
  2. html,body{height:100%;}

  3. div.popbg{ /* backgroung-container*/
  4.     width:100%;
  5.     height:100%;
  6.     position:absolute;
  7.     background: rgba(0,0,0,.6);
  8.  
  9.     z-index: 999;
  10. display: none;
  11. }
  12. div.popdata{
  13.     width:50%;
  14.     height:50%;
  15.     color:white;
  16.     background:#e0e0e0;
  17.     border-radius: 10px;
  18.     text-align:center;
  19.     z-index:9999;
  20.     display:none;
  21. position:absolute;
  22. }


Jquery [ center DIV]
  1. //--------close pop ------------------------//
  2. $('#popclose').click(function() {   
  3. $('#insidediv').empty();
  4. $(".popbg").hide();
  5.      $('.popdata').hide();
  6.        });
  7. //--------------Center Div---------------//
  8. jQuery.fn.center = function(parent) {
  9.     if (parent) {
  10.         parent = this.parent();
  11.     } else {
  12.         parent = window;
  13.     }
  14.     this.css({
  15.         "position": "absolute",
  16.         "top": ((($(parent).height() - this.outerHeight()) / 2) + $(parent).scrollTop() + "px"),
  17.         "left": ((($(parent).width() - this.outerWidth()) / 2) + $(parent).scrollLeft() + "px")
  18.     });
  19. return this;
  20. }