我正在使用以下代码,将鼠标悬停在项目上时,会显示项目中的 3 个菜单选项。标准的东西。
现在,它还通过降低其余项目的 css 来突出显示悬停的项目。这很好用,但实际上太多了,页面最终像灯塔一样闪烁!所以,我希望这些项目#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'});
});
});