0
我想弄清楚幾個小時工作的愚蠢事情,但似乎沒有工作。我得到了Foundation 5模式警報窗口工作從我的javascript.I必須防止刪除操作,如果用戶單擊取消按鈕(在警報上),並執行刪除,如果他們點擊好或十字(X)圖標的權利。 這裏是我的標記和JavaScript爲在取消/ OK模式彈出窗口中添加邏輯單擊,Foundation 5 Modal
<div class="reveal-modal small" id="firstModal" data-reveal>
<p>Are you sure?</p>
<a href="#" class="close-reveal-modal" id="alert-close">×</a>
<a href="#" class="button alert" id="alert-cancel">Cancel</a>
<a href="#" class="button alert" id="alert-ok">Ok</a>
</div>
和Javascript
$('#firstModal').foundation('reveal', 'open');
我試過後的「開放式」加入了回調,但似乎沒有working.Also試圖追趕取消/確定按鈕點擊使用它們的jQuery.None事件works.Now數據被刪除,無論用戶選擇哪一個按鈕 編輯: 我已經試過這樣的事情,但沒有工作oout以及
$('#firstModal').foundation('reveal', 'open', function (value) {
if (value) {
modifySelectList(id, currentDefaultId);
}
else {
$('#firstModal').foundation('reveal', 'close');
}
});
請幫助 由於提前
可以通過添加一些console.log()調用來查看該回調函數的值。 – Bemmu