2016-10-16 7 views
0

での私のjQueryのスクリプトは次のとおりです。jQueryのアコーディオン - オープン複数のパネル一度

jQuery(document).ready(function($) { 
    $("#accordions-727.accordions").accordion({ 
     collapsible: true, active: "false", 
     event: "click", 
     heightStyle: "content", 
    }) 
}) 

だから私は最初のタブを開き、開いたままにして、私は2番目のタブを開いたときに最初の1 closes.Howができたときに私は一度に複数のパネルを開きますか?

私はhere言及されたものを試したが、どれも

+1

の可能性のある重複した[オープン複数のセクションを保持jQueryのUIのアコーディオン?](http://stackoverflow.com/questions/3479447/jquery-ui-accordion-that-keeps-multiple-sections-open) – nycynik

+0

[that](http://stackoverflow.com/questions/15702444/jquery-ui-accordion-open-multiple-panels-at-once)とコード – nivendha

+0

の間のjqueryのバージョンを確認してください。私のバージョンは1.9です。 2 @nivendha – Stew

答えて

0

でしょうが、複数のアコーディオンにそれを回すが、あなたのケースのために正常に動作動いていないようにみえ?

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <link rel="stylesheet" href="./jquery-ui.css"> 
    <script src="./jquery-1.12.4.js"></script> 
    <script src="./jquery-ui.js"></script> 
    <script> 
    $(function() { 
     $(".myaccordion").each(function(index) {$(this).accordion({collapsible:true});}); 
    }); 
    </script> 
</head> 
<body> 
<div class="myaccordion"> 
    <h3>Section 1</h3> 
    <div><p>one</p></div> 
</div> 
<div class="myaccordion"> 
    <h3>Section 2</h3> 
    <div><p>two</p></div> 
</div> 
</body> 
</html> 
関連する問題