0
A
回答
1
还有一个名为SuperSized的插件:http://buildinternet.com/project/supersized/,插件可以处理所有跨浏览器的兼容性,并且可以根据需要在您选择的时间间隔内交换图像。
或者HTML5的方式做到这一点(仅支持Chrome等某些浏览器):http://jsfiddle.net/jfriend00/vzYrf/
html {
background: url(http://photos.smugmug.com/photos/344291068_HdnTo-XL.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
或两个以上的方式做到这一点吧:Perfect Full Page Background Image。
0
它很简单:)
一些CSS:
<style type="text/css"> html { height: 100%; overflow:hidden;} body { background-color: transparent; margin: 0px; padding: 0px; height: 100%; border-top: 1px transparent solid; margin-top: -1px; z-index:0; position:relative; } img#background { height: 100%; width: 100%; z-index: -1; position:absolute; color: black; } </style>
你可以使用这些值打...
和主体内容:
<body bgcolor="#000300" style="margin:0px; width:100%"> <img id="background" src="background.jpg" alt="My Background" /> </body>
这是1背景,其余的你可以用javascript做...
<script type="text/javascript"> function changeBackground(){ var backgrounds = ['back1.jpg', 'back2.jpg', 'back3.jpg']; var inRandom = Math.floor(Math.random() * backgrounds.length); document.getElementById('background').src = backgrounds[inRandom]; setTimeout ("changeBackground()", 10000); } setTimeout ("changeBackground()", 10000); </script>
我没有测试脚本,但是这是基本的想法...
+0
不要忘了提供
有谁推荐别的东西吗? – javi
这是如何工作的?我将它下载并保存在与我的网站保存在同一路径或文件夹中,但是如何激活它?这只是一个文件,那里...新的jQuery,如此混乱大声笑。 – javi
在页面中包含它和jQuery以获取页面中的代码,然后按照使用全屏幕背景幻灯片的说明进行操作。 – jfriend00