今天我发现了一些让我感到困惑的事情.我只是试图通过jquery隐藏s.th ...首先我尝试使用它
$(".specificdiv li:nth-child(3)").click(function(){
$(".anotherdiv").hide();
})
Run Code Online (Sandbox Code Playgroud)
....但它不起作用.
过了一段时间我用这种方式试了一下:
$(".specificdiv li:nth-child(3)").mousedown(function(){
$(".anotherdiv").hide();
})
Run Code Online (Sandbox Code Playgroud)
任何人都可以解释为什么mousedown工作而不是点击?很高兴找到答案
编辑
编辑了另一个.