Reputation: 23
I've set 3 blog posts so that extra content is hidden but then on click slideToggle's down, the problem is, this happens on every element that has the same class.
I can't seem to figure out how to make it so that only one will slide at a click.
$(document).ready(function(showmenu) {
$('.post-footer').click(function() {
$('.post-more-content').slideToggle().delay('500');
setTimeout(function(){$('.post-more-content').slideToggle()}, 30000);
});
});
Upvotes: 2
Views: 208
Reputation: 87073
Try this:
$(document).ready(function (showmenu) {
$('.post-footer').click(function () {
$(this) // clicked element
.parent('article') // move to parent <article>
.find('.post-more-content') // getting more content holder <div>
// of current <article>
.slideToggle();
});
});
Upvotes: 1