解决方案 »
- 验证码一般是用javascript生成的,还是后台生成的?
- js与flash交互 火狐不支持
- $("#testSpan").html(msg); $("#testSpan").text(msg); 有什么区别?val为什么不行
- 用asp.net做个人博客系统时遇到问题
- 有谁碰到过这样的问题?
- 记录修改并保存所作修改操作的问题,请高手赐教!!!
- usercontrol是否一定要放在form里面
- cookies
- DropDownList联动问题求解,代码已上传,请下载帮忙解决
- 使用 C#+ASP.NET+SQLServer 建设的网站 www.xmlchina.net 测试中!
- 关于信息置顶的处理问题
- 编程:求质数的和,例如F(7)=2+3+5+7+11+13+17=58
window.open()
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<!-- meta data -->
<meta http-equiv="Content-Language" content="zh-cn" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" media="screen" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" media="screen" />
<meta name="description" content="网页特效代码" />
<meta name="keywords" content="网页特效,网页特效代码" />
<!-- site title -->
<title>网页特效|网页特效代码(JsHtml.cn)---点击弹出窗口层,并且背景变暗渐变</title><style>
body {font-size:12px;background:#9EC7E7}
img {border:0px}
#msgDiv {
z-index:10001;
width:500px;
height:400px;
background:white;
border:#336699 1px solid;
position:absolute;
left:50%;
top:20%;
font-size:12px;
margin-left:-225px;
display: none;
}
#bgDiv {
display: none;
position: absolute;
top: 0px;
left: 0px;
right:0px;
background-color: #777;
filter:progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75)
opacity: 0.6;
}
</style>
<script type="text/javascript">
function showDetail() { //www.jshtml.cn
//背景
var bgObj=document.getElementById("bgDiv");
bgObj.style.width = document.body.offsetWidth + "px";
bgObj.style.height = screen.height + "px";
//定义窗口
var msgObj=document.getElementById("msgDiv");
msgObj.style.marginTop = -75 + document.documentElement.scrollTop + "px";
//关闭
document.getElementById("msgShut").onclick = function(){
bgObj.style.display = msgObj.style.display = "none";
}
msgObj.style.display = bgObj.style.display = "block";
msgDetail.innerHTML="<p align=center>小窗口里的内容</p><p align=center><A href=http://www.jshtml.cn><FONT color=#0000ff>网页特效代码</FONT></A></p>"
}
</script>
</head>
<body>
<div id="msgDiv">
<div id="msgShut">
关闭</div>
<div id="msgDetail">
</div>
</div>
<div id="bgDiv">
</div>
<p> </p>
<p><a href="#" onClick="showDetail()">点击我试试看</a></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>更多网页特效代码尽在 <a href="http://www.jshtml.cn/">网页特效代码</a></p>
</body>
</html>
window.open()方式
function ShowDialog(url) {
var iWidth=300; //窗口宽度
var iHeight=200;//窗口高度
var iTop=(window.screen.height-iHeight)/2;
var iLeft=(window.screen.width-iWidth)/2;
window.open(url,"Detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,
Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft);
}
window.showModalDialog方式
function ShowDialog(url) {
var iWidth=300; //窗口宽度
var iHeight=200;//窗口高度
var iTop=(window.screen.height-iHeight)/2;
var iLeft=(window.screen.width-iWidth)/2;
window.showModalDialog(url,window,"dialogHeight: "+iHeight+"px; dialogWidth: "+iWidth+"px;
dialogTop: "+iTop+"; dialogLeft: "+iLeft+"; resizable: no; status: no;scroll:no");
}
window.open()方式
function ShowDialog(url) {
var iWidth=300; //窗口宽度
var iHeight=200;//窗口高度
var iTop=(window.screen.height-iHeight)/2;
var iLeft=(window.screen.width-iWidth)/2;
window.open(url,"Detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,
Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft);
}
window.showModalDialog方式
function ShowDialog(url) {
var iWidth=300; //窗口宽度
var iHeight=200;//窗口高度
var iTop=(window.screen.height-iHeight)/2;
var iLeft=(window.screen.width-iWidth)/2;
window.showModalDialog(url,window,"dialogHeight: "+iHeight+"px; dialogWidth: "+iWidth+"px;
dialogTop: "+iTop+"; dialogLeft: "+iLeft+"; resizable: no; status: no;scroll:no");
}
不错的。