Skip to content

Instantly share code, notes, and snippets.

@ameeker
Created January 15, 2019 15:45
Show Gist options
  • Save ameeker/2cf4690deb5521bded0b92feba48cab9 to your computer and use it in GitHub Desktop.
Save ameeker/2cf4690deb5521bded0b92feba48cab9 to your computer and use it in GitHub Desktop.
OptinMonster, Disable Fullscreen Background Clicks
We don't have a method to do this in the builder, but it can be done with some custom JS using our API. Unfortunately, we don't provide further support for this method, so you may need to have your developer take a look to ensure it works as expected for your website.
The way to do this is simple:
document.addEventListener('om.Types.init', event => {
event.detail.Types.Type.bgClose = false;
});
If a customer wants to do this on a case-by-case basis, they can adjust to check the campaign id specifically:
document.addEventListener('om.Types.init', event => {
if ('{slug}' === event.detail.Campaign.id) {
event.detail.Types.Type.bgClose = false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment