我有一個模態窗口,裏面有一個選擇。 模式工作正常,但選擇只能使用一次。 問題是什麼?jquery模式選擇問題
這是我的js。
$s = jQuery.noConflict();
$s(document).ready(function() {
//Display the modal
$s('#att-add').on('click', function (e) {
e.preventDefault();
$s.fn.custombox(this, {
overlay: true,
effect: 'fadein',
eClose: '.close'
});
$s('select').selectric();
});
});
對於我使用Selectric的選擇框。
這是我的HTML模態窗口
<div id="modal" style="display: none;" class="modal-content">
<div class="modal-header">
<button type="button" class="close" title="inchide">×</button>
<h3>Adauga un atribut nou</h3>
</div>
<div class="modal-body">
<div class="form-group">
<label>Numele atributului</label>
<input type="text" name="name" atocomplete="off" />
</div>
<div class="form-group">
<label>Selectati grupul de atribute</label>
<select name="groups" class="select">
{section name=op loop=$groups.attribute_group_id}
<option value="{$groups.attribute_group_id[op]}">{$groups.name[op]}</option>
{/section}
</select>
</div>
<div class="form-group">
<label>Ordinea</label>
<input class="ordine" type="text" name="ordine"/>
</div>
</div>
</div>
當你說「只選擇一次作品」時,你的意思是selectric只在第一次打開模式時才應用?那麼當你關閉模式並再次打開它時,它不會被應用?你是否在控制檯中發現錯誤?你能包含你的HTML嗎? –
我已經包含它 – ciprian2301
您使用模板嗎?問題是模板不起作用,或者電氣造型沒有被應用? –