JavaScript 弹出层
来源:互联网 发布:送货单打印软件系统 编辑:程序博客网 时间:2024/05/16 00:28
一个简单的:JavaScript 弹出层 效果
1.这个是弹出的层和遮罩层的样式
<style type="text/css"> .info { position: absolute; width: 520px; border: 1px; display: none; border-style: solid; border-color: #99BBE8; background-color: #FFFFFF; z-index: 1001; top: 20%; left: 20%; } .bg { border: 2px solid #C5DEF4; position: absolute; width: 100%; height: 100%; z-index: 1000; background-color: #dddddd; opacity: 0.4; filter: alpha(opacity:40); -moz-opacity: 0.4; display: none; top: 0px; left: 0px; } </style>
2.这个是弹出层的JavaScript代码,其中0表示弹出,1表示隐藏
<script type="text/javascript"> function showAndHideDIV(val) { document.getElementById("bg").style.display = (val == 0) ? "inline-block" : "none"; document.getElementById("info1").style.display = (val == 0) ? "inline-block" : "none"; return false; } </script>
3.下面是页面代码
<div> <div id="bg" class="bg"> </div> <div id="info1" class="info"> <table width="500px" bgcolor="dimgray" cellpadding="3" cellspacing="1" style="margin: 10px"> <tr> <td class="t1" colspan="2" style="width: 500px" align="right"> <p style="text-align: center; font-size: 16px; font-weight: bold;"> 一级指标信息维护</p> </td> </tr> <tr> <td class="t3" align="right" nowrap="nowrap" style="width: 100px"> 指标名称: </td> <td class="t1" style="width: 400px"> <tomado:TextBoxForValidate ID="txtFirstName" runat="server" ValidEmptyError="*" AllowEmpty="False" ValidGroup="CheckFirst" Width="300px"></tomado:TextBoxForValidate> </td> </tr> <tr> <td class="t3" align="right" nowrap="nowrap" style="width: 100px; height: 31px;"> 指标分数: </td> <td class="t1" colspan="0" style="width: 400px; height: 31px;"> <tomado:TextBoxForValidate ID="txtFirstGrade" runat="server" ValidEmptyError="*" AllowEmpty="False" Width="300px" ValidGroup="CheckFirst" ValidType="Number"></tomado:TextBoxForValidate> </td> </tr> <tr> <td class="t3" align="right" nowrap="nowrap" style="width: 100px"> 指标备注: </td> <td class="t1" colspan="0" style="width: 400px"> <asp:TextBox ID="txtFirstRemark" runat="server" Width="300px"></asp:TextBox> </td> </tr> <tr> <td class="t1" colspan="2" style="width: 500px" align="right"> <asp:Button ID="btnFirstSave" runat="server" Text=" 保 存 " CssClass="inputButton" ValidationGroup="CheckFirst" OnClick="btnFirstSave_Click" /> <asp:Button ID="btnFirstCancel" runat="server" Text=" 取 消 " OnClientClick="showAndHideDIV(1);" CssClass="inputButton" OnClick="btnFirstCancel_Click" /> </td> </tr> </table> </div></div>
3.1 这个是Html控件
<input type="button" onclick="showAndHideDIV1(0)" value="弹出层" />
3.2 这个是服务器控件 记得加上Return 不然就会弹出了又会关闭,同时在JavaScript里也要加上:return false;
<asp:Button ID="btntest" Text="弹出层" runat="server" OnClientClick="return showAndHideDIV(0);" />
3.3在后台调用弹出层:
ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>showAndHideDIV(0);</script>");
以上是本人在开发中的一些小笔记,希望对大家有所帮助!
- JavaScript弹出层
- javascript 弹出层
- javascript弹出层对话框
- javascript弹出层
- JavaScript - 弹出层
- JavaScript 弹出层
- javascript弹出层
- javascript弹出层
- javascript弹出层
- Javascript弹出层
- JavaScript弹出层效果
- Javascript弹出层的效果
- JavaScript Div 弹出层 遮罩层
- JavaScript弹出层组件easyDialog
- javascript弹出层输入框
- javascript弹出层输入框
- JavaScript实现弹出层代码
- javaScript实现弹出层效果
- /sys/bus/i2c/devices下的内容与i2c_board_info结构体
- 设置 NSZombieEnabled 定位 EXC_BAD_ACCESS 错误
- back键的捕获
- jscript.dll 加载失败
- Linq to SQL how to do “where [column] in (list of values)”
- JavaScript 弹出层
- 让 Xcode 4 自动补全 []、 ""、 ''、 () 的插件
- NYOJ 326 && POJ 3281 Dining (网络流)
- mysqli的扩展函数
- Spring配置中出现的基本类型和集合
- 管道通信
- MyEclipse编译后,classes目录下没有类文件,也没有目录和配置文件
- LinuxI2C总线驱动大致框架
- CXF ,在Client端用于把 Date 类型转换成 XMLGregorianCalendar