Jqueryを使用して次のdivを見つけようとしています。コードは次のとおりです。
$('.menu-item').hover(function() {
$(this).stop(true, true).addClass("menu-item-hover", 300);
$(this).next('div').stop(true, true).fadeIn(300);
}, function() {
$(this).stop(true, true).removeClass("menu-item-hover", 300);
$(this).next('div').stop(true, true).fadeOut(300);
});
<a href="media.html"><div class="menu-item"><h1>Media</h1></div></a>
<div id="tooltip-media">Sights and sounds from Cambodia</div>
<a href="about.html"><div class="menu-item"><h1>About</h1></div></a>
<div id="tooltip-about">Who in the world is the Phillips Family?</div>
単純。toolip-*
div は css に隠されています。コードの次のものをホバー時に表示したいmenu-item
. 他の質問を確認しましたが、私の場合はどれもうまくいきません。Jquery と Jquery UI の両方を使用しています。助けてくれてありがとう。