javascript - How to align a popup center of window -



javascript - How to align a popup center of window -

hello friends trying add together facebook popup box blogger blog, have 1 problem. want popup appear center of webpage position absolute..below code using.. in advance..

<style type='text/css'> #exepopup { background-color: none; position:absolute; z-index: 9999; display: none; padding: 0px; border: 10px solid rgba(82, 82, 82, 0.7); -webkit-background-clip: padding-box; /* safari */ background-clip: padding-box; /* ie9+, firefox 4+, opera, chrome */ -webkit-border-radius: 8px 8px 8px 8px; -moz-border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px; width: 40%; height: 50%; overflow: auto; /* recommended in case content larger container */ margin: auto; /* center item vertically &amp; horizontally */ /* break out of regular flow */ top: 0; left: 0; bottom: 0; right: 0; /* set bounds in center it, relative parent/container */ } #exepopup span { font-size: 12px !important; font-weight: normal !important; } #exepopup h1 { background: #6d84b4 url(http://4.bp.blogspot.com/-wboygfuantq/uvf1f4ouc4i/aaaaaaaabia/rx4jnlicbjm/s1600/aktechz-fb-lock.png) 98% no-repeat; border: 1px solid #3b5998 !important; color: #ffffff !important; font-size: 20px !important; font-weight: 700 !important; padding: 5px !important; margin: 0 !important; font-family: arial !important; overflow: hidden !important; } .exepopupdata { font-size: 12px !important; font-weight: normal !important; height: 275px !important; padding: 1px !important; background: #fff !important; border-bottom: 2px solid #ddd; overflow: show !important; } #exepopupfooter { text-align: left; font-size:12px; background: #f2f2f2 !important; height: auto !important; padding: 10px 10px 10px 10px !important; overflow: hidden !important; } #exepopupclose { float: right; background-color: none !important; border: 0px solid #ccc !important; color: #111 !important; font-weight: normal !important; padding: 5px 8px 5px 8px !important; text-decoration: none !important; display: inline-block !important; font-family: arial !important; outline: none !important; font-size: 12px !important; margin: 0px !important; } #exepopupclose:active { top: 0; left: 0; }</style> <script type='text/javascript'> jquery(document).ready(function() { function exepopupfunc() { var sec = 60 var timer = setinterval(function() { $("#exepopupfooter span").text(sec--); if (sec == 0) { $("#exepopup").fadeout("slow"); clearinterval(timer); } },1000); var exepopupwindow = jquery(window).height(); var exepopupdiv = jquery("#exepopup").height(); var exepopuptop = jquery(window).scrolltop()+50; jquery("#exepopup").css({"top":exepopuptop});} jquery(window).fadein(exepopupfunc).resize(exepopupfunc) //alert(jquery.cookie('sreqshown')); //var exepopupww = jquery(window).width(); //var exepopupwww = jquery("#exepopup").width(); //var exepopupleft = (exepopupww-exepopupwww)/2; var exepopupleft = 500; //var exepopupwindow = jquery(window).height(); //var exepopupdiv = jquery("#exepopup").height(); //var exepopuptop = (jquery(window).scrolltop()+exepopupwindow-exepopupdiv) / 2; jquery("#exepopup").animate({opacity: "1", left: "0" , left: exepopupleft}, 0).show(); jquery("#exepopupclose").click(function() { jquery("#exepopup").animate({opacity: "0", left: "-5000000"}, 1000).show();});}); </script> <div id="exepopup"> <h1>join on facebook</h1> <div class="exepopupdata"><center><iframe src="http://facebook.com/plugins/likebox.php?href=https%3a%2f%2fwww.facebook.com%2fexeideas2010&amp;width=400&amp;colorscheme=light&amp;show_faces=true&amp;border_color=%23fff&amp;stream=false&amp;header=false&amp;height=260" scrolling="no" frameborder="0" style="border:none; overflow:show; width:400px; height:250px;" allowtransparency="true"></iframe></center></div> <div id="exepopupfooter">please wait <span>20</span> seconds<a href="#" id="exepopupclose" onclick="return false;">close x</a></div></div>

just remove css style #exepopup:

bottom: 0; right: 0;

javascript jquery css popupwindow

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -