如何在单击时显示Mailchimp订阅弹出式表单

如何在单击时显示Mailchimp订阅弹出式表单

本文介绍了如何在单击时显示Mailchimp订阅弹出式表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WordPress.单击按钮后,我必须显示Mailchimp订阅弹出窗口.

I am using WordPress. I have to display the Mailchimp subscribe popup on click on the button.

我尝试了以下代码,但未显示我的弹出窗口.我在google和SO上进行了检查,发现了一些解决方案,但没有用.

I tried below code but it's not displaying my popup. I checked on google and SO, I found some solution but that is not working.

您能帮我这个忙吗?

<ul><li class="open-popup"><a href="#">Subscribe to our mailing list</a></li></ul>

    <script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>
    <script>
    function showMailingPopUp() {
        //alert("hello");
        require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us20.list-manage.com","uuid":"bd7ed5583d8f567d56a2ed5ec","lid":"007366445e","uniqueMethods":true})})
        document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
    };
    $(function() {
        $(".open-popup a").on('click', function() {
            showMailingPopUp();
        });
    });
    </script>

有人可以帮我吗?

推荐答案

我遇到了同样的问题-我希望在点击时弹出mailchimp弹出窗口.

I had the same problem - I wanted a mailchimp popup on-click.

我找到的解决方案不是使用mailchimp的"Subscriber popup",而是使用"Embedded form".选项,然后将代码插入到您使用基本的模式"技术创建的弹出式窗口中.

The solution I found was instead of using mailchimp's "Subscriber popup", use the "Embedded forms" option and insert that code within a popup you create yourself using a basic 'modal' technique.

模式教程: https://www.w3schools.com/howto/howto_css_modals.asp

这篇关于如何在单击时显示Mailchimp订阅弹出式表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 13:25