简单的div弹出例子
作者:互联网
示例
弹出层
<p id="spbt" onclick="spbf()" style="cursor:pointer;"">点击</p>
<div id="MyDiv" class="white_content">
<div style="text-align: right; cursor: default; height: 15px;">
<span style="font-size: 16px;margin-right:3px" onclick="CloseDiv('MyDiv','fade')">×</span>
</div>
<div style="text-align: left; cursor: default; height: 18px;">
<span style="font-size: 16px;margin-left:18px" >标题</span>
</div>
</div>
样式
.white_content {
display: none;
position: absolute;
top: 19%;
left: 19%;
width:70%;
height:55%;
border: 1px solid #bfc4c5;
background-color: #f5f5f5;
z-index: 1002;
overflow: auto;
}
js
function CloseDiv(show_div, bg_div) {
$("#MyDiv").hide();
}
function spbf(){
$("#MyDiv").show();
}
标签:function,show,MyDiv,弹出,例子,19%,div 来源: https://blog.csdn.net/wangyu062295/article/details/89140061