因此,使得這個簡單隨機全屏背景圖片頁面,肩和min.js工作, 我敢肯定還有其他的方法來做到這一點,現在我試着讓整個頁面,只需重新加載頁面的鏈接,以便我得到另一個隨機圖像。 我找到了讓轉子div成爲鏈接,CSS解決方案 - 跨度和隱藏顯示的方法,但我當然不知道哪個是合適的,沒有運氣可以讓任何東西工作。任何建議都大加讚賞,全屏鏈接背景
<html>
<head>
<style>
* { margin: 0; padding: 0; }
html {
background: url(images/rotator.php), url(grey.jpg) no-repeat center center fixed ;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#rotator").click(function(){
window.location.reload(true);});
});
</script>
</head>
<body>
<div id="rotator"></div>
</body>
</html>
好了,所以用jQuery的方式沒有運氣,我沒有做到這一點,
<div style="width:800px;height:800px;position:absolute;top:20px;left:20px;" id="rotator" onclick = "window.location.refresh()"></div>
並不理想,但得到我想要的行爲,現在要改變光標讓人們知道它的一個鏈接,
它添加到CSS'光標:pointer' – rgin 2012-03-12 13:00:21