ネストされた div を含むリストがあり、2 つの画像が完全に重なり合っています。スムーズなトランジション効果を生み出すホバー効果を確立しました。ただし、効果はマウスが画像の上にある場合にのみトリガーされ、マウスがリンクの上にある場合はトリガーされません。簡単なアイデアのコードは次のとおりです。
<ul id="shortcuts" class="sitewidth">
<li>
<a href="#">
<div class="shortcuticon box">
<img src="images/icon-learn.png" alt="" class="a">
<img src="images/icon-learn-hover.png" alt="" class="b">
</div>
</a>
</li>
<li>
<a href="#">
<div class="shortcuticon box">
<img src="images/icon-learn.png" alt="" class="a">
<img src="images/icon-learn-hover.png" alt="" class="b">
</div>
</a>
</li>
<li>
<a href="#">
<div class="shortcuticon box">
<img src="images/icon-learn.png" alt="" class="a">
<img src="images/icon-learn-hover.png" alt="" class="b">
</div>
<h2>Hello World!</h2>
</a>
</li>
<script type='text/javascript'>
$(document).ready(function(){
$("img.a").hover(function() {
$(this).stop().animate({"opacity": "0"}, "slow");
}, function() {
$(this).stop().animate({"opacity": "1"}, "slow");
});
});
</script>
</ul>
#shortcuts li a
画像自体ではなく、ホーブ機能を実行する必要があることを認識しています。しかし、このコードは機能しており、私が探しているものの大まかなアイデアが得られます。あなたの親切な助けに感謝します。