2014-12-26 40 views
6

問題很簡單,我不知道爲什麼我沒有得到我想要的行爲,這是Angular UI Bootstrap accordion that I am using,但正如您可以在該示例中看到的唯一一個打開手風琴的方法是,如果你點擊標題,那不是我想要的,現在看看this example, this is what I want,點擊面板上的哪個位置並不重要,只要你點擊標題,面板就會打開。Angular UI手風琴(?)上的全尺寸可點擊面板

,這裏是我使用的代碼:

<accordion close-others="false"> 
     <accordion-group class="fx-fade-right fx-speed-300" 
     ng-repeat="sport in sports | filter:query" 
     ng-show="sport.leagues.length"> 
      <accordion-heading> 
      {{::sport.name}} 
      <span class="pull-right badge">{{::sport.leagues.length}}</span> 
      </accordion-heading> 
      <div class="list-group leagues-margin" 
      ng-click="addSportToLines(sport)"> 
      <a href="javascript:void(0);" class="list-group-item" 
       ng-repeat="league in sport.leagues" 
       ng-class="{active: league.active}" 
       ng-click="addLeagueToLines(league)">{{::league.name}} 
      </a> 
      <a href="javascript:void(0);" 
       class="list-group-item list-group-item-danger" 
       ng-hide="sport.leagues.length">No Leagues 
      </a> 
     </div> 
     </accordion-group> 

回答

7

其實我只是想通了這一點,只需將accordion-heading內容爲div

 <accordion-heading> 
     <div> 
      {{::sport.name}} 
      <span class="pull-right badge">{{::sport.leagues.length}}</span> 
     </div> 
     </accordion-heading> 
+0

參見[這個答案](HTTP: //stackoverflow.com/q/30237114/3850442)如果你有興趣擺脫這個div增加到像我一樣的手風琴標題分散注意力的輪廓。 –