I am using JQuery Accordian, I want to hide all the sections on page load. Only when user clicks on header that section should open. Can any one help me out..
$(document).ready(function() {
$('.accordion-header').toggleClass('inactive-header');
var contentwidth = $('.accordion-header').width();
$('.accordion-content').css({'width' : contentwidth });
$('.accordion-header').first().toggleClass('active-header').toggleClass('inactive-header');
$('.accordion-content').first().slideDown().toggleClass('open-content');
$('.accordion-header').click(function () {
if($(this).is('.inactive-header')) {
$('.active-header').toggleClass('active-header').toggleClass('inactive-header').next().slideToggle().toggleClass('open-content');
$(this).toggleClass('active-header').toggleClass('inactive-header');
$(this).next().slideToggle().toggleClass('open-content');
}
else {
$(this).toggleClass('active-header').toggleClass('inactive-header');
$(this).next().slideToggle().toggleClass('open-content');
}
});
return false;
});
HElp.. Thanks