0

したがって、この単純なランダムフルスクリーンbg画像ページ、rotator、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> 

理想的ではありませんが、私が望む動作を取得します。カーソルを変更して、人々がそのリンクを認識できるようにします。

4

2 に答える 2

0

<div id="rotator">に入れてみてください<a href="" style='display:block;height:100%;width:100%'></a>

于 2012-03-10T20:32:21.803 に答える
0

jQueryを使用する:

$("#rotator").click(function(){
    window.location.reload(true);
});

#rotatorのIDを持つdivにclick()イベントを追加し、事実上巨大なリンクにします。クリックの結果が更新されます。

CSSを使用してマウスカーソルを簡単に変更できます。

#rotator {cursor: pointer; } 
于 2012-03-10T20:32:57.950 に答える