Skip to content

Instantly share code, notes, and snippets.

@tseplik
Forked from scottmagdalein/clickable-element.html
Last active June 3, 2016 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tseplik/ae87e3b6826e5fc46938980683d2f15a to your computer and use it in GitHub Desktop.
Save tseplik/ae87e3b6826e5fc46938980683d2f15a to your computer and use it in GitHub Desktop.
Make the Mailchimp Subscriber popup appear on click
<!-- This is the HTML element that, when clicked, will cause the popup to appear. -->
<body>
...
<button id="open-popup" class="btn btn-danger btn-lg btn-block" onclick="showMailingPopUp()">Subscribe!</button>
...
<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 src="assets/js/mailchimp_popup.js"></script>
...
</body>
function showMailingPopUp() {
require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us12.list-manage.com","uuid":"YOUR_UUID_GOES_HERE","lid":"YOUR_LID_GOES_HERE"}) })
document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
};
@tseplik
Copy link
Author

tseplik commented Jun 3, 2016

a few changes to original scottmagdalein's work based on thaaveragedev's comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment