gpt4 book ai didi

javascript - jQuery toggle() 函数。我想要一些批评或建议以更好地实践

转载 作者:行者123 更新时间:2023-11-30 13:24:34 25 4
gpt4 key购买 nike

我的代码按我希望的方式工作,但我正在寻找任何关于如何 trim 或修改它以提高效率的评论:

$('.toggle-comments').hide(); // this hides the results div when the page loads.                   
$(".comments-toggle-click").click(function () {
$(".toggle-comments").slideToggle("slow");
$(".comments-toggle-click").remove();
});

最佳答案

与其在页面加载时调用 $('.toggle-comments').hide(); 为什么不使用 display:none; 呈现评论?

关于javascript - jQuery toggle() 函数。我想要一些批评或建议以更好地实践,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8965532/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com