Tag: onmouseclick

使用鼠标’点击’而不是’鼠标hover’事件,jquery

我在这里有这个脚本工作正常,但我需要让鼠标点击而不是鼠标hover。 我试过了,但都失败了。 它看起来很简单,但我无法弄清楚。 有人可以帮忙吗? 代码是: $(“.cat”).hover(function(){ $(this).parent().parent().find(“.sub_menu”).hide(); }, function() { $(this).parent().parent().find(“.sub_menu”).show(); });` 下面的代码适用于ie,而不是在firefox中。 $(“.cat”).on(‘click’, function(){ $(this).parent().parent().find(“.sub_menu”).toggle(); });