首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >确认弹出背景解除动画在firefox中不起作用

问确认弹出背景解除动画在firefox中不起作用
EN

Stack Overflow用户
提问于 2019-09-25 02:19:16
回答 1查看 120关注 0票数 0

我正在开发Jquery confirm-js弹出窗口。后台解除动画在firefox最新版本中不起作用。我已经调试了jquery-confirm.js插件文件,当我点击后台空间时,发现没有触发click事件。代码存在于"jquery-confirm.js“插件中,我只是在发现问题的地方添加了引用。有谁能帮帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2019-09-26 02:04:50

插件中的默认代码:

this.$scrollPane = this.$el.find('.jconfirm-scrollpane');

代码语言:javascript
复制
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;
        });

最新修改代码:

代码语言:javascript
复制
$(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事件,它在所有浏览器中都有效。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58086127

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档