我在寻找超大型的替代品。我目前正在使用3.0版本显示一些旋转的背景图像,并在Internet上发现了两个问题。
有谁知道解决这些问题的办法吗?
发布于 2011-12-09 16:39:19
使用任何滑块,并使用z-index将其浮动到页面内容后面。当我只是滑动图片时,我喜欢Nivo滑翔机,当我需要滑动带有任意内容的div或ul时,我喜欢bxSlider。
应用z-index的元素必须是position: relative;或position: absolute。关于position: absolute;需要注意的一点是,它将相对于第一个父元素position: relative;或position: absolute定位元素。这听起来可能令人困惑,那么举个例子如何:
将滑块放入<body>并将其包装在div中:
<body>
<div class="container">
<!-- Your slider divs/imgs/ul -->
</div>
<div class="rest-of-page">
...
</div>
</body>然后是一些css:
/* Position .container relative to body (not really needed, just an example) */
body { position: relative; }
/* Float slider behind content of page, expanding to width/height of document
* and use z-index of -1 to place it behind actual page content. */
.container {
position: absolute;
top: 0%;
left: 50%;
width: 100%;
height: 100%;
z-index: -1;
}
/* Float the actual page content above slider using z-index of 0 */
.rest-of-page { position: relative; z-index: 0; }这样就行了。通常情况下,你必须为你的滑块图像定义一个宽度,但是我认为你可以让它工作。在我自己的项目中,我一直将滑块对准页面,而不是占据整个背景,所以您的里程可能会有所不同。
发布于 2012-11-21 08:34:50
我不确定这能不能满足你的需要。但是你可以看看SuperBGImage。实际上,它的灵感来自超大型,但有一些方便的改进
https://stackoverflow.com/questions/8448194
复制相似问题