84483368 2013-11-22
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
#BgDivOutDivId{background-color:#e3e3e3; position:absolute; z-index:99; left:0; top:0; display:none; width:100%; height:1000px;opacity:0.5;filter: alpha(opacity=50);-moz-opacity: 0.5;}
#xuJiaViewId{position:absolute;width:500px; left:50%; top:50%; margin-left:-200px; height:auto; z-index:100;background-color:#fff; border:1px #8FA4F5 solid; padding:1px;}
#xuJiaViewId .form{padding:10px;}
</style>
<title> New Document </title>
<script type="text/javascript" src="c:/jquery.js"></script>
<script type="text/javascript">
function ShowDIV(thisStred) {
var str=thisStred.name; //这是一字符串
var streds= new Array(); //定义一数组
streds=str.split(","); //字符分割
// --- 上面是字符串截取
$("#BgDivOutDivId").css({ display: "block", height: $(document).height() });
var yscroll = document.documentElement.scrollTop;
$("#xuJiaViewId").css("top", "100px");
$("#xuJiaViewId").css("display", "block");
// 显示就赋值
$("#shengFenZhengID").val(streds[0]);
$("#KeXingMingId").val(streds[1]);
$("#KeHuJingLiId").val(streds[2]);
document.documentElement.scrollTop = 0;
}
function closeDiv() {
// 隐藏就清空
$("#shengFenZhengID").val("");
$("#KeXingMingId").val("");
$("#KeHuJingLiId").val("");
$("#inBlankReason").html("");
$("#BgDivOutDivId").css("display", "none");
$("#xuJiaViewId").css("display", "none");
}
</script>
</head>
<body>
<input type="button" type="button" class="btn" name="中国,美国,日本" id="jiaRuHeiMingDanId" onclick="ShowDIV(this);" value="加入黑名单"/>
<form name="addForm" id="saveFormId" method="post" action="${ctx}/crm-server/crmBlankCtrl/addSubmit.do">
<!-- 隐藏拿到的id号 -->
<div id="BgDivOutDivId"></div>
<div id="xuJiaViewId" style="display: none">
<label style="color: blue">身份证号:</label><input style="color: red" type="text" id="shengFenZhengID" name="idNumber" readonly="readonly" /><br/>
<label style="color: blue">客户姓名:</label><input style="color: red" type="text" id="KeXingMingId" name="cusName" readonly="readonly" /><br/>
<label style="color: blue">客户经理:</label><input style="color: red" type="text" id="KeHuJingLiId" name="cusManagerName" readonly="readonly" /><br/>
<label style="color: blue">列入黑名单原因:</label>
<textarea rows="8" cols="62" name="inBlankReason" id="inBlankReason" maxlength="1900" style="overflow:hidden" dataType="Require" msg="列入原因必填"></textarea>
<input id="saveButtonId" type="button" class="btn" onclick="saveForm();" value="保存"/>
<input id="" type="button" class="btn" onclick="closeDiv();" value="取消"/>
</div>
</form>
</body>
</html>
本文实例讲述了jQuery基于闭包实现的显示与隐藏div功能。分享给大家供大家参考,具体如下:。<p>当前手机号码:<span id="oldPhone">$!{user.phone}</span>&