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.
$(".trigger").click(function () { $(this).next(".toggle").slideToggle("fast"); $(this).toggleClass("active"); return false });
HTML:
<input type="checkbox" class="trigger"> <div class="toggle">content</div>
没有用,代码有什么问题吗?
谢谢
也许先把<div style="display:none" class="toggle">它隐藏起来?另外,return false是不必要的(并且缺少分号)
<div style="display:none" class="toggle">
return false
另外,这个功能在你的内部$(function() {});吗?
$(function() {});