我试图找到一种切换(隐藏/显示)线程注释的解决方案。我只需要看到评论1、2、3等。。。并隐藏1.1、1.2、1.3等。。。单击“显示注释”将切换并显示注释线程。
示例:
1--
-----单击“显示更多评论”显示
-----1.1
-----1.2
-----1.3
-----。。。
2--
-----单击“显示更多评论”显示
-----2.1
-----2.2
-----2.3
-----。。。
我试图找到一种切换(隐藏/显示)线程注释的解决方案。我只需要看到评论1、2、3等。。。并隐藏1.1、1.2、1.3等。。。单击“显示注释”将切换并显示注释线程。
示例:
1--
-----单击“显示更多评论”显示
-----1.1
-----1.2
-----1.3
-----。。。
2--
-----单击“显示更多评论”显示
-----2.1
-----2.2
-----2.3
-----。。。
$(document).ready(function() {
// Toggle all
$(\'#toggle-all\').click(function() {
var $subcomments = $(\'#comments\').find(\'> li > ol\');
if ($subcomments.filter(\':hidden\').length) {
$subcomments.slideDown();
} else {
$subcomments.slideUp();
}
});
// Add buttons to threaded comments
$(\'#comments\').find(\'> li > ol\')
.before(\'<button class="toggle">Show more comments</button>\');
// Toggle one section
$(\'#comments\').find(\'button.toggle\').click(function() {
$(this).next(\'ol\').slideToggle();
});
});
我一开始误解了你的问题,这就是为什么我添加了一个“全部切换”按钮,并将其作为免费奖金留在那里。我在jQuery中获得了社交书签,但如何在这段代码中获得帖子标题和永久链接?如果我把<?php echo get_permalink(); ?> 在那里,整个网站都是空白的。$(\'a[rel=shareit-twitter]\').attr(\'href\', \'http://twitter.com/home?status=\' + title + \'%20-%20\' + title); 更新时间:以下是书签的整个jQuery:<script type=\"text/j