Skip to content

Instantly share code, notes, and snippets.

@adrapper
Forked from scottmagdalein/clickable-element.html
Created February 21, 2017 03:33
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 adrapper/fa7c7d207a5dc4c3f1e07a9fe00db1e1 to your computer and use it in GitHub Desktop.
Save adrapper/fa7c7d207a5dc4c3f1e07a9fe00db1e1 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. -->
<button id="open-popup">Subscribe to our mailing list</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>
function showMailingPopUp() {
require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us11.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";
};
document.getElementById("open-popup").onclick = function() {showMailingPopUp()};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment