Играть с ним здесь: http://jsbin.com/ocicu4/4/editЭто если оператор не работает
Простой Аккордеон, я хочу только одну секцию, открытую в то время.
Я понял, что инструкция if будет работать, но это не так.
// Clicks on h3 show .sectionContent
$('h3.sectionHeading').click(function() {
if ($('h3.sectionHeading').next().is('.open')) {
// Do nothing
} else {
// Find the exsisting div.open remove class and close it
$('div.open').removeClass('open').animate(
{'height':'toggle'}, 'fast', 'linear'
);
// Make div next to h3 open and add class
$(this).next().addClass('open').animate(
{'height':'toggle'}, 'slow', 'linear'
);
}
});
Помощь оценили :)
Хм .. да, это точно так. Я немного смущен. Я не мог понять это сам. Благодарю. – Reynish