点击按钮弹出弹框

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.click_btn{
border: 1px solid cornflowerblue;
background: dodgerblue;
color: #fff;
width: 60px;
line-height: 30px;
text-align: center;
border-radius: 5px;
cursor: pointer;
}
.dialog_bg{
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,0.3);
display: none;
}
.dialog_cont{
position: absolute;
width: 300px;
height: 300px;
transform: translate(-50%,-50%);
top: 50%;
left: 50%;
background: #fff;
}
.close{
position: absolute;
right: 0;
top: 0;
font-size: 20px;
}
</style>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
<div id="clickbtn" class="click_btn">
按钮
</div>
<div class="dialog_bg">
<div class="dialog_cont">
<div id="close_btn" class="close">×</div>
<div>
这里是要显示的地方
<!--<iframe src="" width="" height=""></iframe>-->
</div>
</div>
</div>
</body>
<script type="text/javascript">
$(document).ready(function(){
$("#clickbtn").on('click',function(){
$(".dialog_bg").show();
})
$("#close_btn").on('click',function(){
$(".dialog_bg").hide();
})
})
</script>
</html>javascript

转载于:https://www.cnblogs.com/XFJ-XXX/p/8184614.htmlcss