div弹出层关闭不了,点击关闭之后就是一直放大页面
<script type="text/javascript">
//弹出隐藏层
function ShowDiv(show_div,bg_div,asdf){
document.getElementById(show_div).style.display='block';
document.getElementById(bg_div).style.display='block' ;
document.getElementById('_id').value=asdf;
var bgdiv = document.getElementById(bg_div);
bgdiv.style.width = document.body.scrollWidth;
// bgdiv.style.height = $(document).height();
$("#"+bg_div).height($(document).height());
};
//关闭弹出层
function CloseDiv(show_div,bg_div)
{
document.getElementById(show_div).style.display='none';
document.getElementById(bg_div).style.display='none';
};
</script>
<form action="{% url 'h:top_up_a' top.id %}" method="post" name="top_up" id="gnmdgrd">
{% csrf_token %}
<label>
<input style= "background-color:transparent;border:0;" type="button" value="充值" onclick="ShowDiv('MyDiv','fade','{{ top.id }}')" />
<input type="hidden" name="id" value="{{ top.id }}">
<input type="hidden" name="sb" value="{{ top.id }}">
<div>
<div id="fade" class="black_overlay">
</div>
<div id="MyDiv" class="white_content">
<div style="text-align: right; cursor: default; height: 40px;">
<span style="font-size: 20px;" onclick="CloseDiv('MyDiv','fade')">X</span>
</div>
输入充值金额:<input type="text" value="" name="je">
<br/>
确认充值金额:<input type="text" value="" name="qr">
<br/>
<input type="hidden" name="state" id="state" value="1">
<input type="hidden" name="sb" value="{{ top.id }}">
<input type="hidden" name="_id" id="_id">
<input style= "float: contour;background-color:transparent;border:0;" type="submit" value="确定">
</div>
</div>
</label>
</form>
点击关闭的效果

//弹出隐藏层
function ShowDiv(show_div,bg_div,asdf){
document.getElementById(show_div).style.display='block';
document.getElementById(bg_div).style.display='block' ;
document.getElementById('_id').value=asdf;
var bgdiv = document.getElementById(bg_div);
bgdiv.style.width = document.body.scrollWidth;
// bgdiv.style.height = $(document).height();
$("#"+bg_div).height($(document).height());
};
//关闭弹出层
function CloseDiv(show_div,bg_div)
{
document.getElementById(show_div).style.display='none';
document.getElementById(bg_div).style.display='none';
};
</script>
<form action="{% url 'h:top_up_a' top.id %}" method="post" name="top_up" id="gnmdgrd">
{% csrf_token %}
<label>
<input style= "background-color:transparent;border:0;" type="button" value="充值" onclick="ShowDiv('MyDiv','fade','{{ top.id }}')" />
<input type="hidden" name="id" value="{{ top.id }}">
<input type="hidden" name="sb" value="{{ top.id }}">
<div>
<div id="fade" class="black_overlay">
</div>
<div id="MyDiv" class="white_content">
<div style="text-align: right; cursor: default; height: 40px;">
<span style="font-size: 20px;" onclick="CloseDiv('MyDiv','fade')">X</span>
</div>
输入充值金额:<input type="text" value="" name="je">
<br/>
确认充值金额:<input type="text" value="" name="qr">
<br/>
<input type="hidden" name="state" id="state" value="1">
<input type="hidden" name="sb" value="{{ top.id }}">
<input type="hidden" name="_id" id="_id">
<input style= "float: contour;background-color:transparent;border:0;" type="submit" value="确定">
</div>
</div>
</label>
</form>
点击关闭的效果

...全文
相关推荐
js html页面点击小图弹出div放大查看原图
jquery.lightbox-0.5 点击小图放大效果; 修正了点击图片出现虚线框的问题; 修正了图像宽度比浏览器窗口大时,出现滚动条的问题,显示的大图片自动适应浏览器页面大小,不出现滚动条。 原效果地址 http://leandrovieira.com/projects/jquery/lightbox/
js做的点击当前页面按钮弹出一个层,类似于淘宝网页面图片预览,很漂亮
js做的点击当前页面按钮弹出一个层,类似于淘宝网页面图片预览,很漂亮,里面的js和css文件都在里面,直接拷贝就可以用了,非常方便
div+css弹出层带关闭按钮
整理div+css弹出层,带关闭按钮供大家参考
弹出层关闭父页面刷新
弹出一个窗口关闭后刷新父页面,自己试过可以,不知道是不是你们要的效果
js 点击页面其他地方关闭弹出层(示例代码)
代码如下:<html> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /> <title>无标题文档</title> <style type=”text/css”> <!– *{font-size:12px;font-family:Verdana, Geneva, sans-serif;line-height:14px} a{color:#039} a:hover{color:#f60} .pop{position:absolute;left:40%;top:40%;width:300px;h


