修复 jQuery Lightbox 在页面上的位置
我正在尝试在灯箱内显示我的博客 @ TechQuark.com 的订阅选项!你可以打开博客并查看同样的内容,4-5秒后会弹出一个灯箱。
一切都很好,只是问题是这个灯箱的位置在屏幕上不是固定的,即它不随页面滚动。
这是我正在使用的 CSS:
/*Subscription Pop Up Css*/
#popupContactClose{
cursor: pointer;
text-decoration:none;
}
#backgroundPopup{
display:none;
position:fixed;
_position:absolute; /* hack for internet explorer 6*/
height:100%;
width:100%;
top:0;
left:0;
background:#000000;
border:1px solid #cecece;
z-index:1;
}
#popupContact{
display:none;
position: fixed;
_position:absolute; /* hack for internet explorer 6*/
height:350px;
width:350px;
background:#FFFFFF;
border:2px solid #cecece;
z-index:2;
padding:12px;
font-size:13px;
}
#popupContact h1{
text-align:left;
color:#000000;
font-size:20px;
font-family:georgia, times new roman, arial;
font-weight:700;
border-bottom:1px dotted #D3D3D3;
padding-bottom:2px;
margin-bottom:20px;
}
#popupContactClose{
font-size:20px;
line-height:14px;
right:6px;
top:4px;
position:absolute;
color:#000000;
font-weight:700;
display:block;
}
/*End Subscription Pop Up Css */
这是弹出代码:
<div id='popupContact'>
<a id='popupContactClose'>x</a>
<h1>Subscribe to Tech Guru</h1>
// Code for Subscribing Option
</div>
<div id='backgroundPopup'/>
请帮忙!
I'm trying to display subscription options for my blog @ TechQuark.com inside a lightbox! You can open the blog and check the same, a light box would pop up in 4-5 sec.
Everything is fine, just the issue is that the poition of this lightbox is not fixed wrt screen, i.e. it does not scroll with the page.
Here is the CSS I'm using :
/*Subscription Pop Up Css*/
#popupContactClose{
cursor: pointer;
text-decoration:none;
}
#backgroundPopup{
display:none;
position:fixed;
_position:absolute; /* hack for internet explorer 6*/
height:100%;
width:100%;
top:0;
left:0;
background:#000000;
border:1px solid #cecece;
z-index:1;
}
#popupContact{
display:none;
position: fixed;
_position:absolute; /* hack for internet explorer 6*/
height:350px;
width:350px;
background:#FFFFFF;
border:2px solid #cecece;
z-index:2;
padding:12px;
font-size:13px;
}
#popupContact h1{
text-align:left;
color:#000000;
font-size:20px;
font-family:georgia, times new roman, arial;
font-weight:700;
border-bottom:1px dotted #D3D3D3;
padding-bottom:2px;
margin-bottom:20px;
}
#popupContactClose{
font-size:20px;
line-height:14px;
right:6px;
top:4px;
position:absolute;
color:#000000;
font-weight:700;
display:block;
}
/*End Subscription Pop Up Css */
And here is the Pop Up Code:
<div id='popupContact'>
<a id='popupContactClose'>x</a>
<h1>Subscribe to Tech Guru</h1>
// Code for Subscribing Option
</div>
<div id='backgroundPopup'/>
Please help !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚访问该网站,在第 800 行找到了这一点:
这两个百分比都需要用引号引起来。现在,他们正在生成一个错误。
Just went to the site, and found this on line 800:
both of those percentages need to be in quotes. right now, they're generating an error.