-1
我搜查了很多,我的一些人也尝试了。切换查看Jquery并隐藏Div
只要你点击阅读更多的部分,我想实现一个(在这种情况下,Wordpress摘录显示)摘录消失,完整的帖子顺利下降。
到目前为止,这是我的代码
<div class="dropdown dropdown-processed">
<a class="dropdown-link trigger" href="#"><i class="fa
fa-caret-down" aria-hidden="true"></i></a> <a class="close trigger"
href="#"><i class="fa fa-times" aria-hidden="true"></i></a>
<div class="excerpt">
<?php the_excerpt(); ?>
</div>
<div id="<?php echo the_ID(); ?>" class="dropdown-container"
style="display: none;">
<div class="full-content">
<?php the_content(); ?>
<?php
if(have_rows('downloads')):
echo '<h4>Weiter Informationen zum Download:</h4>';
echo '<ul class="fa-ul">';
while (have_rows('downloads')) : the_row(); ?>
<li><i class="fa-li fa fa-arrow-down"></i><a href="<?php
the_sub_field('file'); ?>" title="<?php the_sub_field('title'); ?>"><?php the_sub_field('title'); ?></a></li>
<?php
endwhile;
else :
// no rows found
endif;
?>
</ul>
</div>
添加我使用的代码从http://jsfiddle.net/NFTFw/29/到只有一个后打开的时间,现在我需要隐藏的提取物,并进行密切按钮,所以我有限的jQuery功能我加入这个
$(document).ready(function() {
$("close").hide();
$('div.dropdown').each(function() {
var $dropdown = $(this);
$("a.dropdown-link", $dropdown).click(function(e) {
e.preventDefault();
$div = $("div.dropdown-container", $dropdown);
$div.toggle();
$("div.dropdown-container").not($div).hide();
$("a.dropdown-link").hide();
$(".excerpt").hide();
$(".close").show();
return false;
});
});
$('html').click(function() {
$("div.dropdown-container").hide();
});
});
$(document).ready(function() {
$(".close", $hide).click(function(e) {
e.preventDefault();
$div = $("div.dropdown-container", $hide);
$div.toggle();
$("div.dropdown-container").not($div).show();
$("a.dropdown-link").show();
$(".excerpt").show();
$(".close").hide();
return false;
});
});
不是它不仅隐藏一个摘录,但所有,不给我更多(mehr lesen)按钮,但只是关闭按钮,根本没有内容。
有人可以发现问题(或问题),也许可以解释我做错了什么?
由于提前
我认为它有助于你的要求[https://codepen.io/maxds/pen/jgeoA](https://codepen.io/maxds/pen/jgeoA) –
没有帮助,因为它应该像在jsfiddle中一样工作,不会显示两个帖子,并且我需要使用Wordpress的摘录()和content()函数。 – akira