あなたの考えを共有するをクリックすると、それぞれのインスタンスのコメントブロックがスライドします。私が望むのは、特定のセクションだけでなくすべてではなくなるということです。以下は私のコードのスニペットです。 実際に私はすべてのセクションをPHPを使って動的に作成しています。私のページにはほぼ10-15のセクションがあり、特定のセクションをクリックしてもコメントブロックは各セクションごとにダウンしています。 これは可能です。私のページにあるセクションの数にかかわらず、ボタンをクリックすると、単一のブロックだけが下にスライドします。jqueryスライドをシングルインスタンスのみに表示しますか?
$('.down').click(function() {
// Set the effect type
var effect = 'slide';
// Set the options for the effect type chosen
var options = { direction: 'up' };
// Set the duration (default: 400 milliseconds)
var duration = 700;
\t $('.card').toggle(effect, options, duration);
});
#comments{
background-color: #535d92;
display: none;
height:60px;
}
#slide {
width: 90%;
margin-top: 14px;
margin-left: 14px;
\t z-index:1;
border: none;
\t border-radius: 2.5em;
\t background: #fff;
\t -webkit-appearance: none;
outline:none;
\t padding: 0.85em 1.5em;
\t height:10%;
}
.cd-container {
width: 90%;
margin: 0 auto;
}
.post-footer ul {list-style:none}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<div class="container">
<section class="cd-container">
<div class="cd-timeline-content">
<h3>raghav</h3>
\t <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
\t <div class="post-footer">
\t <ul>
\t <li class="down"><a href="#">Share your thoughts</a></li>
\t </ul> \t
\t </div>
\t </div><br/>
\t \t <div id="comments" class="card">
\t \t <input type="text" id="slide" placeholder="Hit Enter to Send!" class="boom"/>
</div>
</section> <!-- cd-timeline --><br>
\t \t \t \t \t \t \t
<section class="cd-container">
<div class="cd-timeline-content">
<h3>sharad</h3>
\t \t \t \t <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
\t <div class="post-footer">
\t <ul>
\t <li class="down"><a href="#">Share your thoughts</a></li>
\t </ul> \t
</div>
\t </div><br/>
\t <div id="comments" class="card">
<input type="text" id="slide" placeholder="Hit Enter to Send!" class="boom"/>
\t </div>
</section>
</div>
それは私のために働いた。ありがとう –
@raghavp歓声。 gr8それは助け! – Iceman
誰かがコメントを残すことなく下降しました。なぜだろう? – Iceman