項目にカーソルを合わせると、項目内に 3 つのメニュー オプションが表示される次のコードを使用しています。標準的なもの。
現在は、残りの項目の css を下げることで、ホバーされた項目も強調表示します。これはうまく機能しますが、実際には多すぎて、ページがビーコンのように点滅してしまいます! だから、マウスが「タイル」の1つにカーソルを合わせ#tiles li
たときに表示されたいずれかに入ると、アイテムの不透明度を変更したいgl_comments gl_like or gl_readd
mouseenter
現在の関数内にまったく新しい関数を記述する必要がありmouseenter
ますか? その場合、親の「タイル」だけを選択するにはどうすればよいですか?
現在使用中:
$(document).ready(function(){
$("body").on("mouseenter", "#tiles li", function ()
{
$(this).children(".gl_comments").fadeIn("fast");
$(this).children(".gl_readd").fadeIn("fast");
$(this).children(".gl_like").fadeIn("fast");
$('#tiles li').css({opacity: '0.1'});
$(this).css({opacity: '1'});
});
$("body").on("mouseleave", "#tiles li", function ()
{
$(this).children(".gl_comments").fadeOut("fast");
$(this).children(".gl_readd").fadeOut("fast");
$(this).children(".gl_like").fadeOut("fast");
$('#tiles li').css({opacity: '1'});
});
});