我一直运行到这个问题,因为热闹的短期记忆丧失......选择DIV
我试图做的是slideToggle
驻留在相同的父元素作为按钮div元素。
每个加载的页面上都有多个html结构,因此选择正确的相应结构是目标。
<div class="exBtn">
<a href="#">
<img src="<?php echo get_template_directory_uri(); ?>/media/showTextButton.png">
</a>
</div>
<div class="initialPostLoad">
<?php the_content('Read the rest of this entry »'); ?>
</div> <!-- end initialPostLoad -->
$(document).ready(function() {
$('.exBtn a').click(function (event) {
event.preventDefault();
$(this).parent().closest('.initialPostLoad').slideToggle();
});
});
啊啊我一直对父母,孩子和兄弟姐妹感到困惑。这来自不是独生子的人... – canacast
@canacast也许你来自诺福克... – lonesomeday