Jquery Div居中

$(document).ready(function(){

//打开    
 $("#open").click( function () {
    
         
            $(
"#showBox").show().css("top",($(document).height()-200)/2 ).css("left",($(document).width()-400)/2 );
          }    );
         
          
//关闭
           $("#close").click( function () {
            $(
"#showBox").hide();
          }    );

    });

复制代码
posted @ 2012-07-08 09:34  stma  阅读(1441)  评论(0)    收藏  举报