ボタンをクリックしてテキストを拡大したり折りたたんだりするのに問題があります。私はあなたがボタンをクリックするとテキストを崩壊させることができましたが、それを元に戻すことができるようにする必要もあります。私は最初にそれを隠すようにする必要があり、ボタンをクリックするとそれが消費され、その後に再び折りたたむことができます。ここに私のコードはjQueryの展開と折りたたみのテキスト
$(document).ready(function() {
$('#btnSlideUp').click(function() {
$('#p1').slideUp(1000);
});
$('#btnSlideDown').click(function() {
$('#p1').slideDown(1000);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<button id="btnSlideUp" class="btn btn-outline-success"><h1 class="jumbotron-heading">Expand</h1></button>
<p class="lead text-muted" id="p1">Below this post you can find different articles, tips&tricks about how to find the job. You can try to contact us, and we will greatly try to answer all of your questions. You can click on "Start finding a job" and we will take you through the basics
of finding a job, from the beginning till the end if you have absolutely no excperience.</p>
<p>
<a href="contactus.html"><button type="button" class="btn btn-
outline-primary btn-lg">Contact Us</button></a>
<a href="path.html"><button type="button" class="btn btn-outline
secondary btn-lg">Start finding a job</button></a>
</p>
</div>
申し訳ありませんが、あなたの答えは私にとってはうまくいくと思いますが、簡単な質問です。ページが読み込まれたときにテキストを非表示にしてから、ユーザーがクリックするとテキストが表示されます。 – iKON1K
@ iKON1Kは** CSS **プロパティ 'display:none'を使用し、ユーザーが* expand *をクリックしたときに' $( '#p1')。show() ' –
を使用します。たくさん – iKON1K