我正在开发Jquery confirm-js弹出窗口。后台解除动画在firefox最新版本中不起作用。我已经调试了jquery-confirm.js插件文件,当我点击后台空间时,发现没有触发click事件。代码存在于"jquery-confirm.js“插件中,我只是在发现问题的地方添加了引用。有谁能帮帮我吗?
发布于 2019-09-26 02:04:50
插件中的默认代码:
this.$scrollPane = this.$el.find('.jconfirm-scrollpane');
this.$scrollPane.click(function(e){
{
if(!that.boxClicked){
var buttonName = false;
var shouldClose = false;
var str;
if(typeof that.backgroundDismiss === 'function')
str = that.backgroundDismiss();
else
str = that.backgroundDismiss;
if(typeof str === 'string' && typeof that.buttons[str] !== 'undefined'){
buttonName = str;
shouldClose = false;
}else if(typeof str === 'undefined' || !!(str) === true){
shouldClose = true;
}else{
shouldClose = false;
}
if(buttonName){
var btnResponse = that.buttons[buttonName].action.apply(that);
shouldClose = (typeof btnResponse === 'undefined')|| (btnResponse);
}
if(shouldClose)
that.close();
else
that.hiLightModal();
}
that.boxClicked = false;
});最新修改代码:
$(document).on('click','.jconfirm-open',function(e){
if(!that.boxClicked){`
var buttonName = false;
var shouldClose = false;
var str;
if(typeof that.backgroundDismiss === 'function')
str = that.backgroundDismiss();
else
str = that.backgroundDismiss;
if(typeof str === 'string' && typeof that.buttons[str] !== 'undefined'){
buttonName = str;
shouldClose = false;
}else if(typeof str === 'undefined' || !!(str) === true){
shouldClose = true;
}else{
shouldClose = false;
}
if(buttonName){
var btnResponse = that.buttons[buttonName].action.apply(that);
shouldClose = (typeof btnResponse === 'undefined') || !!(btnResponse);
}
if(shouldClose)
that.close();
else
that.hiLightModal();
}
that.boxClicked = false;
});上面的类".jquery-scrollPane“click事件在firefox浏览器中不起作用,尤其是在最新版本中。我尝试使用父div类(查看弹出窗口,你会发现),并应用了click事件,它在所有浏览器中都有效。
https://stackoverflow.com/questions/58086127
复制相似问题