Skip to content

Instantly share code, notes, and snippets.

@kerminz

kerminz/abr-modal.js

Last active Feb 3, 2020
Embed
What would you like to do?
AB Rocket Onboarding Example Experiment
var banner_bottom = '<div class="banner-bottom">'+
' <div class="banner-bottom-content">'+
' <span>Lorem Ipsum Dolor!</span>'+
' <a class="c-btn" target="_blank" href="https://www.google.com" title="Click me">CLICK ME!</a>'+
' </div>'+
' <div class="banner-close">'+
' x'+
' </div>'+
'</div>';
abrocket.API.whenConditionIsMet(function() {
return jQuery !== undefined && !!document.querySelector('body')
}, function() {
if (!abrocket.API.getCookie('k-banner-bottom-close')) {
jQuery(banner_bottom).insertBefore('body');
document.querySelector('.banner-bottom-content > a').addEventListener('click', function() {
//abrocket.API.pushGoal('YOUR_GOAL_ID')
})
jQuery('.banner-close').on('click', function() {
abrocket.API.setCookie('k-banner-bottom-close', true, 30)
document.querySelector('.banner-bottom').style.display = "none"
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment