I regularly have show/hide elements for things like FAQ's and use the following code:
HTML:
<div class="faq">
<h2 class="faq_q toggle-section">Question</h2>
<div class="faq_a content-section">Answer</div>
</div>
<div class="faq">
<h2 class="faq_q toggle-section">Question</h2>
<div class="faq_a content-section">Answer</div>
</div>
JS:
// Show / Hide Sections
$(".toggle-section").next(".content-section").hide();
$(".toggle-section").click(function() {
$(this).toggleClass('active').next().slideToggle("fast");
});
Which works well but on this occasion I need a few selected questions on page load but I just can't figure out what I need to do in order for that to happen.
Any help would be very much appreciated.