Advertisement
Guest User

Untitled

a guest
May 21st, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const priceCheck = () => {
  2.     let price = document.querySelector(".landing #pricelist .head");
  3.  
  4.     if (!price) { return; }
  5.  
  6.     price = price.getBoundingClientRect().top - window.innerHeight;
  7.  
  8.     if ( price <= 0 ) {
  9.         Analytics.yaCounter('landingPrice');
  10.         Analytics.googleAnalytics('send','event','scrollEvents','landingPrice');
  11.  
  12.         if (key == "perm" && template == 53) {
  13.             Analytics.roistatGoal('Достиг прайса на /apple', "", 0);
  14.             Analytics.roistat("to-price-apple");
  15.         }
  16.  
  17.         window.removeEventListener("scroll", priceCheck);
  18.     }
  19. };
  20.  
  21. const footerCheck = () => {
  22.     let footer = document.querySelector('.landing footer');
  23.  
  24.     if (!footer) { return; }
  25.  
  26.     footer = footer.getBoundingClientRect().top - window.innerHeight;
  27.  
  28.     if ( footer <= 0 ) {
  29.         Analytics.yaCounter('landingFooter');
  30.         Analytics.googleAnalytics('send','event','scrollEvents','landingFooter');
  31.         window.removeEventListener("scroll", footerCheck);
  32.     }
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement