简体   繁体   English

背景图片顶部的幻灯片幻化,作为页面背景

[英]Fading slideshow on top of background image, as page background

My site currently has a single, large, static image as its background image. 我的网站当前有一个大的静态图片作为背景图片。 I would like to add a looping slide-show of 3 images above the background image, but still below everything else. 我想在背景图片上方添​​加3张图片的循环幻灯片显示,但在其他所有图片下方。 The slide-show images are just different sized white pngs with partial transparency, and should fade through smoothly into each other. 幻灯片图像是大小不同的白色png,具有部分透明性,并且应平滑地彼此淡入。 The intended effect is to continually highlight different areas of the background image (the rest of the page will stay unaffected). 预期的效果是连续突出显示背景图像的不同区域(页面的其余部分不会受到影响)。

What must I add to my CSS file to place the slide-show above the background image but below everything else? 我必须添加什么到CSS文件中才能将幻灯片放到背景图片上方,但在其他所有图片下方? Currently, for the single image I have: 目前,对于单个图像,我有:

body {
background-color: #000000;
background-image:url('/images/wallpaper.jpg');
background-attachment:fixed;
background-repeat:no-repeat;
background-position:top center;
color: #555; 
font: 70%/1.5  Verdana, 'Trebuchet MS', arial, sans-serif;
text-align: center; 
margin: 15px 0;
}

I found a jQuery application ( Innerfade ) for fading images, do I need to add anything to my body of my page to run it, or will everything work from the CSS? 我找到了一个用于使图像褪色的jQuery应用程序( Innerfade ),是否需要在页面正文中添加任何内容来运行它,还是一切都可以在CSS中使用?

Thankyou for any help! 感谢您的任何帮助!

You need to position the elements with different z-indexes. 您需要使用不同的z索引定位元素。 For example 例如

#slideshow{
position: relative;
z-index: 1;
}

#otherContent{
position: relative;
z-index: 2
}

The position is needed for z-index to work. 该位置是z-index工作所需的。 Now the slideshow has a lower z-index (depth in space) as the otherContent. 现在,幻灯片显示的z-index(在空间中的深度)比otherContent低。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM