欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

弹出框css技巧_html/css_WEB-ITnose

程序员文章站 2022-04-13 20:21:50
...
技术要点:

一个覆盖整个屏幕的浅灰色背景的div,一个包含内容的的div,

代码如下:

弹出框标题
弹出框信息
$(document).ready(function(){    var m1_top = ( $(window).height() - $("#financeTipInfor").height() )/2; var m1_left = ( $(window).width() - $("#financeTipInfor").width() )/2;    $("#financeTipInfor").css({"margin": m1_top + "px" +" "+ m1_left + "px"}); window.onresize=function(){  var m1_top = ( $(window).height() - $("#financeTipInfor").height() )/2; var m1_left = ( $(window).width() - $("#financeTipInfor").width() )/2;    // $("#financeTipInfor").css({"margin": m1_top + "px auto","left": m1_left + "px"}); $("#financeTipInfor").css({"margin": m1_top + "px" +" "+ m1_left + "px"}); }  $(".close").click(function () {      $("#financeTip").css({"display": "none"});      });});
#financeTip{width:100%;overflow:hidden;}.financeTankuang{width:90%;}@media (min-width: 768px){.financeTankuang{width:600px;}}.financeTipBg{position:absolute;width:100%;height:100%;background:#000;z-index:8001;left:0;top:0;opacity:0.2}#financeTipInfor{position:absolute;left:0;top:0;z-index:8011;}
相关标签: 弹出框css技巧