标签:closed tom htm script animate cti html show pac
<div id="popBox"> <div class="popCont"> <a class="closed">关闭</a> </div> </div>
body{position: relative;} #popBox{position: absolute;left: 0;top:0;right: 0;bottom: 0;background: rgba(0,0,0,.5);z-index: 500;display: none;} .popCont{position: fixed;width: 530px;height: 450px;background: #fff;} .closed{position: absolute;right: 0;top:0;}
<script> function showDiv(sId){ var getId=$(sId); getId.height($(‘body‘).height()); getId.stop(true,true).show().stop(true,true).animate({opacity:‘1‘},200); var firstDiv=getId.find(‘div:first‘); var h=firstDiv.height(); var w=firstDiv.width(); firstDiv.css({ ‘position‘:‘fixed‘, ‘left‘:‘50%‘, ‘top‘:‘50%‘, ‘margin-top‘:-h/2+‘px‘, ‘margin-left‘:-w/2+‘px‘ }) firstDiv.click(function(e){ e.stopPropagation(); }); getId.click(function(){ $(this).stop(true,true).hide().stop(true,true).animate({opacity:‘0‘},200); }); $(‘.closed‘).click(function(){ getId.stop(true,true).hide().stop(true,true).animate({opacity:‘0‘},200); }); } </script>
标签:closed tom htm script animate cti html show pac
原文地址:http://www.cnblogs.com/lifecandy/p/6164096.html