HTML Div叠加层

时间:2010-01-02 18:27:03

标签: html overlay

我想要一个像thickbox这样的html叠加代码,它可以在所有浏览器中使用。

你可以告诉相关的网址或其他东西......

问候 KK

2 个答案:

答案 0 :(得分:1)

周围有很多*盒子脚本。 我确信它们都不适用于所有存在的所有浏览器,但大多数主流解决方案(如Thickbox本身)应该在所有主要浏览器中表现良好,这是最好的请求。

查看以下列表:

对于任何更具体的内容,您必须详细了解。

答案 1 :(得分:0)

我制作了自己的灯箱,这就是我正在使用的东西,肯定会回到IE6。你只需要制作一个div并将其直接附加到身体上。你需要制作一个半透明的png图像作为你的背景。

html, body{height:100%;}

#lightbox_darkLayer{
    display: block;
    position: fixed;
    top: 0px;
    left: 0px;
    _top: expression(((ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)) + 'px'); 
    _left: expression(((ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft)) + 'px');
    width: 100%;
    height: 100%;
    background:url(/images/overlayBg.png) repeat;
    z-index:1001;
    _filter: alpha(opacity=70);/*This is for IE6 who won't support a translucent png as a bg image*/
}

以下划线为前缀的css属性适用于IE。你可以通过使用他们的html comment if check thing向IE添加一些CSS来做到这一点。