如果你想让它工作,试试这个。只需在显示隐藏的 div 后执行 javascript,您将拥有:
<div class="default">
<input type="text" class="form-control tokenfield1" value="" />
</div>
<a href="#" class="show pull-right">Show</a>
<div class="clearfix"></div>
<div class="another">
<input type="text" class="form-control tokenfield2" value="" />
</div>
和:
$('.show').click(function() {
$('.another').slideToggle();
$('.tokenfield2').tokenfield({
autocomplete: {
source: ['Red City','Blue City','United Kingdom','Australia','United Sates','Finland','Bulgeriya','Hungary','Istambul'],
delay: 100
},
showAutocompleteOnFocus: true
});
});
$('.tokenfield1').tokenfield({
autocomplete: {
source: ['Red City','Blue City','United Kingdom','Australia','United Sates','Finland','Bulgeriya','Hungary','Istambul'],
delay: 100
},
showAutocompleteOnFocus: true
});