我有一個輸入焦點事件的偵聽器,但是當輸入該事件時,模態將無限期啓動。Jquery確認無限啓動窗口
$('.input').on('focus',function() {
$.confirm({
theme: 'material',
title: 'Atention',
content: '¿Content?',
useBootstrap: false,
boxWidth:'200px'
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.2.0/jquery-confirm.min.js"></script>
<input type="date" class="input">
但如果我這樣做的確認窗口不會無限期地顯示
$(this).confirm({...});
有什麼用$.confirm
VS $(this).confirm
的差異,爲什麼出這麼多的窗口次
其中$ symb ol是不是輸入? (這個)是否與輸入相同?
我認爲在這種情況下,您需要將確認事件直接綁定到您的元素,這意味着使用$(this)綁定 –
這不是確認是問題,它是指定的事件處理程序 – Bindrid