I\'m trying to create a simple modal popup. I have the CSS done, and the Javascript mostly done. I\'m at the point where I click a button at the button of the page and the pop
try position: fixed
for your css, it won't scroll with this, also check display HTML page after loading complete
example:
<style>
#floater {float:left; height:50%; margin-bottom:-1px;}
#top {position: fixed; top:0; left: 0; width: 100%; height: 100%; background: #fff}
#content {clear:both; height:540px; position:relative; height: 100%; width: 100%;}
</style>
<div id="top">
<div id="floater"></div>
<div id="content">
<div style="border: 1px solid #DDD; padding: 10px; background: #BBB; width: 300px; margin: 0 auto">Popup Contents Here</div>
</div>
</top>
#top
element makes hides background, you can make it transparent but still unclickable.#floater
and #content
are for vertical centering.Modal Popup, OnClose popup event, and more!
https://github.com/reduardo7/xpopup