【发布时间】:2016-12-06 18:28:09
【问题描述】:
我有一个创建以下 html 的 jquery 插件
<div class="panel-heading">
<h4 class="">
<a data-toggle="collapse" href="#collapse2" class="collapsible-title display-inline full-width bold">Select Gigs</a>
</h4>
</div>
<div id="collapse2" class="panel-collapse collapse">
<div class="panel-body">
<div class="row">
<div class="col-xs-12">
<input type="text" class="input-text-field margin-medium-bottom" placeholder="Search" />
</div>
</div>
...... and some other divs here .....
当点击上面的<a></a> 时,我想切换 id 为 collapse2 的 div。如果我在hbs 文件中添加html,它工作正常。但是当我在 jquery 中创建上面的 html 并按如下方式插入 DOM 时,它将 url 更改为 domain/#collapse2
_initializeAutoComplete: function () {
Ember.$('#' + this.get('divId')).setAutocomplete({
data: this.get('dataTree'),
multiSelect: true,
selectingType: 3
});
}.on('didInsertElement')
});
如何在不将 ember 作为 url 更改为 href 的情况下进行切换? 感谢任何帮助。
【问题讨论】:
标签: javascript jquery html twitter-bootstrap ember.js