daily pastebin goal
33%
SHARE
TWEET

05 - Detecta scroll

edusan Jan 3rd, 2014 268 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. window.addEventListener ?
  3.   window.addEventListener('scroll', testScroll, false) :
  4.   window.attachEvent('onScroll', testScroll);
  5.  
  6. var scrollCount = 0;
  7.  
  8. function testScroll() {
  9.   ++scrollCount;
  10.   if (scrollCount == 2) {
  11.     dataLayer.push({ 'event': 'aceptacookies'});
  12.   }
  13. }
  14. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top