我正在尝试使用内部按钮制作一个引导手风琴,该按钮将折叠当前手风琴段并打开下一个手风琴,由于某种原因,这不起作用。
HTML:
<div ng-controller="AccordionDemoCtrl">
<accordion>
<accordion-group id="firstpanel" heading="Static Header 1" is-open="status.isFirstOpen">
<span id="span1">This content is straight in the template.</span><br>
<button id="nextpanel">Next</button>
</accordion-group>
<accordion-group heading="Static Header 2">
<span id="span1">This content is straight in the template.</span>
</accordion-group>
</accordion>
</div>
JAVASCRIPT:
angular.module('plunker', ['ui.bootstrap']);
function AccordionDemoCtrl($scope) {
$scope.status = {
isFirstOpen: true,
isFirstDisabled: false
};
$("#nextpanel").on("click", function() {
$(firstpanel).click();
});
}
我在这里做了一个 plunker 的例子:Plunker