如题
谁有相关代码给我 感激不尽
谁有相关代码给我 感激不尽
解决方案 »
- DataList嵌套GridView的编辑问题,急~在线等
- 对sql server的并发访问(update)超过40左右就出错,如何用事务解决呢
- CompositeControl 中的DataBinding能否执行
- 请问下在.net上面使用ajax和access数据库为什么不能打开?
- 问一这这样一个发短信的.收多少钱合适!
- 如何只打开一次数据库,增加不同内容到数据表。
- 全局变量怎么使用的问题~~?
- 【怎么构建多级树形结构的下拉列表框】--在线等,马上结帐
- DataGrid如何显示数据库中的Image字段数据?
- 模态子窗口数据更新后,如何把刷新父窗口?在线等
- ajax 文本框输入自动提示 undefined
- 如何在后台获得ObjectDataSource正在执行的对象的属性
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PopDiv.aspx.cs" Inherits="PopDiv" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript" src="../JS/JScript.js"></script>
<link rel="stylesheet" href="../CSS/control.css" />
</head>
<body style="height:100%">
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
<input id="Button2" type="button" value="模拟DIV弹出窗口" onclick="ShowDiv('light');ShowDiv('fade');"/>
</div>
<div id="light" class="white_content">
这里是弹出窗口内容.
<a href="javascript:void(0)" onclick="HideDiv('light');HideDiv('fade');">
Close</a>
</div>
<div id="fade" class="black_overlay" >
</div>
</form>
</body>
</html>
//显示DIV
function ShowDiv(id)
{
var div=document.getElementById(id);
div.style.display='block';
}//隐藏DIV
function HideDiv(id)
{
var div=document.getElementById(id);
div.style.display='none';
}//显示/隐藏DIV
function OpDiv(id)
{
var div=document.getElementById(id);
if(div.style.display=='block')
{
div.style.display='none';
}
else
{
div.style.display='block';
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>弹出层</title>
<style type="text/css">
html,body{height:100%;width:100%}
</style>
</head>
<body >
<form id="form1" runat="server">
<input onclick="tan()" type="button" value="弹出层" />
</form>
</body>
</html>
<script type="text/javascript">
function tan()
{
var d=document.createElement("div");
d.id="bg"
with(d.style){
position="absolute";
left=0;
top=0;
background="black";
filter="Alpha(Opacity=60)"
opacity=0.6
width="100%"
height="100%"
}
document.body.appendChild(d);
d.onclick=function(){document.body.removeChild(document.getElementById('bg'))}
}
</script>top,left设置弹出层的位置,filter设置弹出层的透明度,opacity也是设置透明度(用来兼容火孤),position设置DIV为浮动的
其实你只要把这个例子看懂了,你就可以弹出任何内容的层