<div class="form-control" id="sign_in" style="display:none">
<input type="text" class="form-control" placeholder="Username">
<input type="text" class="form-control" placeholder="password">
<input type="button" class="btn btn-primary" value="sign in">
<input type="button" class="btn btn-success" value="cancle">
</div>
<script>
function signIn() {
addBg();
var alert_sign_in = document.getElementById("sign_in");
alert_sign_in.style.display = "block";
alert_sign_in.style.position = "absolute";
alert_sign_in.style.top = "50%";
alert_sign_in.style.left = "50%";
alert_sign_in.style.marginTop = "-75px";
alert_sign_in.style.marginLeft = "-150px";
alert_sign_in.style.width = "500px";
alert_sign_in.style.height = "700px";
alert_sign_in.style.zIndex = "501";
var mybg = document.createElement("div");
mybg.setAttribute("id","mybg");
mybg.style.background = "#000";
mybg.style.width = "100%";
mybg.style.height = "100%";
mybg.style.position = "absolute";
mybg.style.top = "0";
mybg.style.left = "0";
mybg.style.zIndex = "500";
mybg.style.opacity = "0.3";
mybg.style.filter = "alpha(opacity=30)";
document.body.appendChild(mybg);
document.body.style.overflow = "hidden";
}
</script>
这个是一个弹出式的登录功能,先有个遮罩层,然后弹出一个form供用户输入信息,请问这个这个form如何关闭?就是用户取消登录的时候,遮罩层自动取消,然后form自动关闭。
弹出式的登录功能是这样写的吗?有没有其他的写法,谢谢。
加载使用jquery,显示层:$("#sign_in").show(),隐藏层:$("#sign_in").hide()
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。