webwml/js/jquery.accordion.min.js

25 lines
726 B
JavaScript

$(document).ready(function () {
$('div.accordionButton').click(function () {
if ($(this).next().is(':hidden') == true) {
$(this).addClass('on');
$(this).removeClass('off');
$(this).next().slideDown('normal');
} else {
$(this).removeClass('on');
$(this).addClass('off');
$(this).next().slideUp('normal');
}
});
$('.switch').click(function()
{
$('.accordionContent').slideDown('normal');
$('.accordionButton').addClass('on');
$('.accordionButton').removeClass('off');
}
);
$('.accordionButton').addClass('off');
$('div.accordionContent').hide();
$(".open").trigger('click');
});