아코디언 목록이 포함 된 사이드 메뉴를 만들었습니다. 페이지를로드 할 때 페이지로드시 활성화되도록 코딩 되었기 때문에 아코디언 목록의 섹션 하나가 열려 있습니다. 그러나 다른 섹션을 열려고 시도하면 섹션이 열리지 만 곧 닫힙니다. 누군가 내가 잘못 가고 있다고 말할 수 있습니까?왜 내 아코디언 목록은 계속 닫히고 있습니까?
목록 코드 :
<ion-content class="has-header" id="accordian"scroll="false" ng-controller="MainCtrl">
<ul>
<li class="active">
<h3><span class="icon-dashboard"></span>Group 1</h3>
<ul>
<li ng-repeat="card in cards"><a href="#">{{ card.title }}</a></li>
</ul>
</li>
<!-- we will keep this LI open by default -->
<li>
<h3><span class="icon-tasks"></span>Group 2</h3>
<ul>
<li ng-repeat="card in cards"><a href="#">{{ card.title }}</a></li>
</ul>
</li>
<li>
<h3><span class="icon-calendar"></span>Group 3</h3>
<ul>
<li ng-repeat="card in cards"><a href="#">{{ card.title }}</a></li>
</ul>
</li>
</ul>
JS : 아코디언의
$(document).ready(function(){
$("#accordian h3").click(function(){
//slide up all the link lists
$("#accordian ul ul").slideUp();
//slide down the link list below the h3 clicked - only if its closed
if(!$(this).next().is(":visible"))
{
$(this).next().slideDown();
}
})
})
내 JS 예제를 사용하여 나를 보여줄 수 있습니까? 나는 이것을 시도하고 그것을 전부 끊었습니까? – TheGarrett
@ theGarrett을 확인하십시오. –