HTML + CSS + JQuery实现弹框
2017-12-13 15:05
567 查看
HTML + CSS + JQuery实现弹框
CSS
HTML
JQuery
CSS
<style type="text/css"> #fullbg { background-color: gray; left: 0; opacity: 0.6; position: absolute; top: 0; z-index: 50000; filter: alpha(opacity = 50); -moz-opacity: 0.5; -khtml-opacity: 0.5; } #dialog { left: 43%; margin: -200px 0 0 -200px; position: fixed !important; /* 浮动对话框 */ position: absolute; top: 30%; z-index: 100000; display: none; } </style>
HTML
<div id="fullbg"></div> <div id="dialog"> <div id="remarkDiv" style="margin-left: 0px; width: 100%;background-color: #e5e5e5;border-radius:10px;"> <div id="dialogTitleDiv" style="background-color:#a7c0ce;border-radius:10px 10px 0 0;height:40px;font-size:20px;font-weight:bold;padding-top:15px;" align="center"> 备注 </div> <div id="dialogContentDiv" style="padding:20px 10px 0 10px;"> <textarea rows="5" style="width:350px;" id="auditRemark"></textarea> </div> <span align="center" name='errMsgTip' style="display:block;color:red;"></span> <div align="center" bgcolor="#cccccc"> <input type="button" value="关闭" style="width:120px;margin-bottom:15px;" onclick="closeBg()" class="btn" /> <input type="button" value="提交" style="width:120px;margin-bottom:15px;" onclick="" class="btn" /> </div> </div> </div>
JQuery
<script type="text/javascript"> function showBg() { $("#dialog").show(); $("#remarkDiv").show(); var bh = $("body").height(); var bw = $("body").width(); $("#fullbg").css({ height : bh, width : bw, display : "block" }); } //关闭灰色 jQuery 遮罩 function closeBg() { $("#fullbg,#dialog").hide(); $("[name='errMsgTip']").text('') } </script>
相关文章推荐
- jquery+css实现html选择树或树形菜单
- web前端,html+css+jquery实现水平菜单
- html、css和jquery相结合实现简单的进度条效果实例代码
- HTMl+CSS+JQuery实现简单的图片滑动切换
- html+css+jquery实现折叠板(模仿搜索风云榜折叠板)
- html+css+jQuery+JavaScript实现tab自动切换功能
- jQuery+css+html实现页面遮罩弹出框
- 使用jquery + css + html实现点击左右箭头切换图片
- html+css+jquery实现选项卡(模仿搜索风云榜选项卡)
- HTML+CSS+jQuery实现弹幕技术
- html+css+jquery实现右下角返回顶部功能
- Html+css+jQuery实现扫雷游戏(一)初步设计
- jQuery+css+html实现页面遮罩弹出框
- jQuery+css+html实现页面遮罩弹出框
- html+css+jQuery实现多种图片简单切换功能大综合
- html+css+jQuery实现多种图片简单切换功能大综合
- 模仿百度教育->考试日历控件, 自己用html+css+jquery实现
- Html+css、javascript和JQuery三种方法实现导航条下拉菜单的炫酷效果
- html、css和jquery相结合实现简单的进度条效果实例代码
- jQuery+css+html实现页面遮罩弹出框