jquery 通过css 弹出悬浮框的办法
2014-01-21 13:54
344 查看
1是在body后面append一个div,div的position是absolute,位置大小是整个document的大小。这样就把页面全部变灰了。
2是把弹出的那个div显示出来,position也是用absolute。设置位置
js内容
html内容
css内容
2是把弹出的那个div显示出来,position也是用absolute。设置位置
js内容
var ShowBox = function(o, option) { var docheight = $(document).height(); $("body").append("<div class='Box-background'></div>"); $(".Box-background").css({ "opacity" : "0.6", "height" : docheight }); var winHeight = document.documentElement.clientHeight; var winWidth = document.documentElement.clientWidth; $(o).css({ "top" : (200 + (winHeight - o.height()) / 2) + "px", "left" : (winWidth - o.width()) / 2 + "px" }).show(); };
ShowBox($(".nwd-float"));
html内容
<div class="Windows nwd-float"> <div class="nwd-closediv"><a href="javascript:" class="nwd-close"></a></div> <div class="nwd-content"> <span id="takeSuccSpan"></span> <a href="/xiangmu/"></a> </div> </div>
css内容
.Box-background { background: none repeat scroll 0 0 #000000; display: block; left: 0; position: absolute; top: 0; width: 100%; z-index: 100; } .Windows { color: #643B1B; display: none; left: 0; position: absolute; top: 0; width: 503px; z-index: 204; }
相关文章推荐
- jquery弹出层div+css实用代码
- jquery鼠标放上去显示悬浮层(弹出div层)定位
- jquery.form.js上传文件ie弹出下载文件解决办法
- JQuery插件fancybox无法在弹出层使用左右键的解决办法
- JQuery 悬浮弹出框
- jquery鼠标放上去显示悬浮层即弹出定位的div层
- 鼠标滑过文字弹出一段说明文字CSS实现,不通过JS实现
- 通过jquery获得某个元素的位置, 透明div, 弹出框, 然后在旁边显示toggle子级联菜单-hover的bug解决
- jquery修改网页背景颜色通过css方法实现
- 利用CSS、Jquery和div实现的横弹出菜单
- jQuery鼠标悬浮链接弹出跟随图片实例代码
- mouseleave mouseout时候悬浮框不应该消失的时候消失了 css 解决办法
- jQuery+css+html实现页面遮罩弹出框
- jQuery+css+html实现页面遮罩弹出框
- 【荐】Jquery+CSS打造的泡沫弹出框式的侧边蓝色导航菜单
- jquery封装了一个简洁轻巧的可拖动可自定义样式的纯div+css带遮罩层的仿模态弹出框
- 分享使用jQuery和CSS实现的一个超酷缩略图悬浮逼近效果
- jquery鼠标放上去显示悬浮层即弹出定位的div层
- 鼠标悬浮弹出标题制作JQuery
- jquery+css 实现即时变化颜色主题(通过input输入颜色值进行改变)