0

4 秒ごとに切り替わる 2 つのバナー (画像) があります。1 つの画像はクリック可能で、もう 1 つはクリック可能ではありません。以下はコードです、

<div class="contentdiv"> 
  <h:commandLink  action="#{myBean.firstBannerClick}" id="firstBanner" style="text-decoration:none;">
  <img src="/firstImage.jpg" width="590" height="210"  border="0" class="clickable"/> 
  </h:commandLink> 
</div>

<div class="contentdiv"> 
    <img src="/secondImage.jpg" width="590" height="210"  border="0" class="notClickable"/> 
</div>

編集:以下のコードも試しました

$(function(){
    $('.clickable a').hover(function(){
        $(this).css({'cursor':'pointer'});
    },function(){
        $(this).css({'cursor':'default'});
    });
});

$(function(){
    $('.notClickable a').hover(function(){
        $(this).css({'cursor':'default'});
    },function(){
        $(this).css({'cursor':'default'});
    });
});

編集はここまで

以下、CSS中古です。

<style type="text/css">
.clickable
{
cursor: pointer;
}
.clickable a:hover
{
cursor: pointer;
}
.notClickable
{
cursor: default;
}
.notClickable a:HOVER
{
cursor: default;
}

.chrome .clickable
{
cursor: pointer;
}
.chrome .clickable a:hover
{
cursor: pointer;
}
.chrome .notClickable
{
cursor: default;
}
.chrome .notClickable a:HOVER
{
cursor: default;
}
</style>

画像が切り替わると、ユーザーがカーソルを画像の上に移動すると、最初の画像がポインターとして表示されます。2 番目の画像に切り替えが発生し、ユーザーがカーソルを画像から離していない場合、2 番目の画像もデフォルトではなくポインターとして表示されます。ユーザーがカーソルを 2 番目の画像に移動した場合にのみ、それがデフォルトとして変更され、ユーザーは 2 番目の画像がクリックできないことを知るようになります。

この問題は FF では見られません。一方、これは Chrome と IE で見られます。

この質問は、この質問の続きと見なすことができます。現在、問題はブラウザに固有のものであるため、新しい問題として提起しました。

4

1 に答える 1

0

次のように、マウス カーソルを手動で変更できます。

// Changes the cursor to an hourglass
function cursor_wait() {
    document.body.style.cursor = 'wait';
}

// Returns the cursor to the default pointer
function cursor_clear() {
    document.body.style.cursor = 'default';
}
于 2012-12-17T08:26:24.777 に答える