我如何确定对话框在 jQuery 中显示的次数。 我有一个模式弹出对话框,我希望当用户单击某个内容两次时该对话框显示,而第三次单击时则不显示。
$(document).ready(function(){
$('#something_to_clicked').click(function(){
$('#dialog_content').dialog({modal: true});
});
});
最佳答案
$(document).ready(function(){
var timesShown = 0;
$('#something_to_clicked').click(function(){
if (timesShown == 2) return;
$('#dialog_content').dialog({modal: true});
timesShown++
});
});
关于jquery - 我如何使 jQuery 对话框弹出特定次数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10351489/