3月份做了比较多的在线能力测试或笔试题 ,我记得有一道题是自己使用原生js实现一个组件实现自定义的模态框或弹出框
需求:
1、模态框在浏览器居中显示
2、有关闭和确认功能
3、弹出模态框后使浏览器蒙层( 遮罩层),不能进行原始界面的操作
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>自定义弹出框</title>
<style type="text/css">
*{
margin:0px;padding:0px;}
body{
height:1000px;}
<!--#AppConfirm{
position:relative;margin:0 auto;}-->
#modlue{
position:fixed;left:50%;top:50%;width:400px;height:260px; margin-left:-200px;margin-top:-150px;
visibility:hidden;background-color:#fff;z-index:100;border:1px solid grey;overflow: