NikolayBezay

Hist trigger modal campaign by event

Jan 29th, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <script>
  2. (function() {
  3. var waitPageTriggerElement = setInterval(function() {
  4. var pageTriggerElement = document.querySelector('.profile-hover-button > button[class*="redirect-button"]');
  5. if (pageTriggerElement && adoric) {
  6. clearInterval(waitPageTriggerElement);
  7. pageTriggerElement.addEventListener('click', function() {
  8. adoric.lightboxes.filter(function(lb){return lb.isShowing && lb.options.campaignId === '601264aa734c3f024bc25c21'})[0].close(4);
  9. console.log('show modal');
  10. setTimeout(function(){
  11. adoric.trigger('showModalInpage');
  12. }, 200);
  13. });
  14. }
  15. }, 1000);
  16. setTimeout(function() {
  17. clearInterval(waitPageTriggerElement);
  18. }, 10000);
  19. })();
  20. </script>
Advertisement
Add Comment
Please, Sign In to add comment