简体   繁体   English

Elementor 弹出窗口 jQuery

[英]Elementor Pop-up with jQuery

I have a problem.我有个问题。 I made a custom Pop-up using elementor and now added a custom jQuery code for the pop-up menu to close on the menu-item click.我使用 elementor 制作了一个自定义弹出窗口,现在为弹出菜单添加了一个自定义代码 jQuery 以在单击菜单项时关闭。 I have ordered the Elementor to open via action in elementor and close via the code.我已命令 Elementor 通过 elementor 中的操作打开并通过代码关闭。 Picture of elementor action for popup弹出窗口的元素或动作图片

The code is following.代码如下。

<script>
jQuery(function($){
$(document).on('click','.elementor-location-popup .menu-item', function(event){
elementorProFrontend.modules.popup.closePopup({}, event );
});
});
</script>

The problem is, that every click on different elements on the page, for example the admin bar, the contact form etc, the popup opens, event though not ordered to do so.问题是,每次点击页面上的不同元素,例如管理栏、联系表等,弹出窗口都会打开,尽管没有命令这样做。 Has anyone had the same issue with elementor popup?有没有人对 elementor 弹出窗口有同样的问题? Has it something to do with the jQuery document value?跟jQuery文档值有关系吗? Or should I seek help from elementor?还是应该向elementor寻求帮助?

Got the fix.得到修复。 It is an Elementor bug.. They still have not fixed it, even with the latest update.这是一个 Elementor 错误。即使有最新的更新,他们仍然没有修复它。 The issue was not with jQuery code, but with Elementor settings.问题不在于 jQuery 代码,而在于 Elementor 设置。

I had to eliminate all the popup conditions and triggers from elementor side and just use a dynamic elementor button opening and jQuery button closing.我必须从 elementor 端消除所有弹出条件和触发器,只使用动态 elementor 按钮打开和 jQuery 按钮关闭。 Somehow the triggers produced the bug, that opened the popup on a random page click.触发器以某种方式产生了错误,该错误会在随机页面点击时打开弹出窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM