Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
寻求帮助:如何隐藏在 DIV 外部单击另一个链接的链接。这是我的示例,它隐藏了在 div 外部单击的链接:
jsfiddle.net/xbJ6u/
像这样将图层ID更改为类
<div id="layer">
至
<div class="layer">
注意:ID 必须是唯一的
然后点击隐藏图层
$('.link').click(function (e) { $('.layer').hide();
演示