してください、jQueryのUIを使用しないでください。あなたは、トリガーがクリックされたときに開かれているすべてのパネルを閉じて、最も近いボタンの横にパネルを開くには、通常の方法を使用することができます。
$(function() {
// Hide all panels
$('#accordion .content').hide();
// Add active class to the first trigger, then find the next panel and open with .slideDown() effect
$('#accordion h2:first').addClass('active').next().slideDown('slow');
// When the trigger is clicked...
$('#accordion h2').click(function() {
if($(this).next().is(':hidden')) {
// Remove all "active" classes and close all the panels that has been opened.
$('#accordion h2').removeClass('active').next().slideUp('slow');
// Open one panel that placed right next to the trigger
// only if the next panel is hidden
$(this).toggleClass('active').next().slideDown('slow');
}
});
});
は
次に例を示します。http://jsfiddle.net/tovic/CzE3q/ ・ホープこのヘルプ:)
絶対配置は使用しないでください。あなたのコンテンツスタックを( 'position:static' - デフォルトまたは' position:relative')しましょう。 – Phrogz
jQueryタグをアニメーションに使用していると仮定して追加しました。そうでない場合は、あなたの「トグルオープン」をどのように達成しているかを明確にしてください。 – Phrogz