以下のコードを使用および変更しました。私が必要としているとおりに機能しますが、同じページで複数回使用すると、すべての抜粋が同時に開きます。クリックされたアイテムだけを停止して開くには、その理由と、何をする必要があるか知っていますか?
HTML:
<article class="excerpt">
<h2>Title</h2>
<p>This is a sentence...</p>
<div class="full-story">
<p>This is the rest of the first sentence...</p>
</div>
<a class="excerpt-trigger" href="#">Read More</a>
</article>
jQuery:
$('.full-story').hide();
$('.excerpt-trigger').toggle(function() {
$('.full-story').fadeIn('slow');
$(".excerpt-trigger").removeClass("is-more");
$(".excerpt-trigger").addClass("is-less");
$(this).text("Less info");
}, function() {
$('.full-story').hide('fast');
$(".excerpt-trigger").addClass("is-more");
$(".excerpt-trigger").removeClass("is-less");
$(this).text("More info");
});
申し訳ありませんが、抜粋トリガー クラスを除外しました。更新しました。