弹出div浮动登陆框 背景变灰
2013-02-28 14:44
816 查看
[html] view
plaincopy
<!--要浮动的框子-->
<div class="quitOKorNo" id="quitOKorNo" >
</div>
[css] view
plaincopy
.quitOKorNo{ display:none; position:absolute; background-color:White; z-index:200;width:200px; border:1px #F8CFA5 solid; font-size:12px; height:50px; color:Black; line-height:50px; text-align:center}
[css] view
plaincopy
#greybackground { background:#000; display:block; z-index:100; width:100%; position:absolute; top:0; left:0;}
[javascript] view
plaincopy
$("#quitOKorNo").html("打开弹出框和设置背景框!");
$("#quitOKorNo").fadeIn(100);
$("body").append("<div id='greybackground'></div>");
var documentheight = $(window.document).height();//获取此页面高度,包括下拉部分
$("#greybackground").css({"opacity":"0.3","height":documentheight});
[javascript] view
plaincopy
//浮动框的效果 和位置设定js代码
[javascript] view
plaincopy
var screenwidth,screenheight,mytop,getPosLeft,getPosTop
screenwidth = $(window).width();
screenheight = $(window).height();
mytop = $(document).scrollTop();
getPosLeft = screenwidth/2 - 100;
getPosTop = screenheight/2 - 150;
$("#quitOKorNo").css({"left":getPosLeft,"top":getPosTop+80});
$(window).resize(function()
{
screenwidth = $(window).width();
screenheight = $(window).height();
mytop = $(document).scrollTop();
getPosLeft = screenwidth/2 - 100;
getPosTop = screenheight/2 - 150;
$("#quitOKorNo").css({"left":getPosLeft,"top":getPosTop+mytop+80});
});
//滚动条事件
$(window).scroll(function()
{
screenwidth = $(window).width();
screenheight = $(window).height();
mytop = $(document).scrollTop();
getPosLeft = screenwidth/2 - 100;
getPosTop = screenheight/2 - 150;
$("#quitOKorNo").css({"left":getPosLeft,"top":getPosTop+mytop+80});
});
plaincopy
<!--要浮动的框子-->
<div class="quitOKorNo" id="quitOKorNo" >
</div>
[css] view
plaincopy
.quitOKorNo{ display:none; position:absolute; background-color:White; z-index:200;width:200px; border:1px #F8CFA5 solid; font-size:12px; height:50px; color:Black; line-height:50px; text-align:center}
[css] view
plaincopy
#greybackground { background:#000; display:block; z-index:100; width:100%; position:absolute; top:0; left:0;}
[javascript] view
plaincopy
$("#quitOKorNo").html("打开弹出框和设置背景框!");
$("#quitOKorNo").fadeIn(100);
$("body").append("<div id='greybackground'></div>");
var documentheight = $(window.document).height();//获取此页面高度,包括下拉部分
$("#greybackground").css({"opacity":"0.3","height":documentheight});
[javascript] view
plaincopy
//浮动框的效果 和位置设定js代码
[javascript] view
plaincopy
var screenwidth,screenheight,mytop,getPosLeft,getPosTop
screenwidth = $(window).width();
screenheight = $(window).height();
mytop = $(document).scrollTop();
getPosLeft = screenwidth/2 - 100;
getPosTop = screenheight/2 - 150;
$("#quitOKorNo").css({"left":getPosLeft,"top":getPosTop+80});
$(window).resize(function()
{
screenwidth = $(window).width();
screenheight = $(window).height();
mytop = $(document).scrollTop();
getPosLeft = screenwidth/2 - 100;
getPosTop = screenheight/2 - 150;
$("#quitOKorNo").css({"left":getPosLeft,"top":getPosTop+mytop+80});
});
//滚动条事件
$(window).scroll(function()
{
screenwidth = $(window).width();
screenheight = $(window).height();
mytop = $(document).scrollTop();
getPosLeft = screenwidth/2 - 100;
getPosTop = screenheight/2 - 150;
$("#quitOKorNo").css({"left":getPosLeft,"top":getPosTop+mytop+80});
});
相关文章推荐
- 弹出div浮动登陆框 背景变灰
- phoenixframe自动化测试平台对div弹出框(如弹出的div登陆框)的处理
- js弹窗 js弹出DIV,并使整个页面背景变暗
- 网站div浮动层同时网站背景变灰代码兼容firefox,谷歌浏览器(Chrome)
- 一个div,弹出第二个div的浮动。
- 基于jquery ui修改的不依赖第三方的背景透明的弹出div
- JS弹窗 JS弹出DIV并使整个页面背景变暗功能的实现代码
- js弹出一个可拖拽的div+背景变灰
- js+CSS实现弹出居中背景半透明div层的方法
- JS居中弹出div,背景变暗
- js弹出一个可拖拽的div+背景变灰
- 弹出的锁定背景的DIV对话框,关闭按钮如何实现?
- div+css实现简单的弹出窗(背景变灰色)
- 弹出框出现时,背景变淡(仿百度登陆弹框)
- JavaScript实现弹出DIV层同时页面背景渐变成半透明效果
- IE7下的浮动弹出框背景透明,背景为黑色改为透明
- 弹出一个注册div,后面背景变灰
- js实现页面查询弹出div隐藏背景提示进度
- jQuery+html5实现div弹出层并遮罩背景
- (简单的弹出div 覆盖背景)改善用户体验之alert提示效果 http://www.blueidea.com/tech/web/2006/4185.asp