我知道如何实现全屏/可扩展背景图像;我通常使用jQuery方法。 EG:http://tinyurl.com/9yl4rbw全屏幕背景图像+旋转图像?
但是!我试图让它每次页面被访问时背景图像都不同。不是幻灯片放映;但像旧的JavaScript(EG:http://www.computerhope.com/j18.htm)
我怎么能结合这两个; jQuery的可扩展背景和页面刷新新图像的JavaScript?
任何人都遇到过这种效果的质量插件?
* Edit_ _ _ *
我使用了jQuery方法与上述参考URL之内;下面主要:
<!--Expandable BG code IE 7 +-->
<style>
#bg { position: fixed; top: 0; left: 0; }
.bgwidth { width: 100%; }
.bgheight { height: 100%; }
#page-wrap { position: relative; width: 950px; margin-left: auto; margin-right: auto;; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(function() {
var theWindow = $(window),
$bg = $("#bg"),
aspectRatio = $bg.width()/$bg.height();
function resizeBg() {
if ((theWindow.width()/theWindow.height()) < aspectRatio) {
$bg
.removeClass()
.addClass('bgheight');
} else {
$bg
.removeClass()
.addClass('bgwidth');
}
}
theWindow.resize(function() {
resizeBg();
}).trigger("resize");
});
</script>
<!--Expandable BG code IE 7 +-->
<!--Full BG Call-->
<img src="Sandwichfullbg.jpg" id="bg" >
<div id="page-wrap">
<!--End Full BG Call-->
我想找到一个简单的解决方案给在新的页面访问或页面刷新的背景变化;理想地拥有大约30张图片。 EG:刷新页面>新的rad图像;刷新页面>新的rad图像; (x 30)
究竟是你使用jQuery的方法?它是如何工作的? – Nick
刚刚编辑我的Q描述上面.. –