reekside

intoday.in

Jul 8th, 2016
1,373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. $(document).ready(function () {
  2. /*
  3. for(var i=1;i<=2;i++){
  4. //$('#zedoads'+i).append('yipee! an advertisement');
  5. //document.write('<div id="zedoads'+i+'" style="visibility: hidden;">yipee! an advertisement</div>');
  6. checkAds('zedoads'+i);
  7. }*/
  8. setTimeout(checkAds.bind(null, 'zedoads1'), 4000);
  9. })
  10.  
  11. function openPopup() {
  12. var win_height_n = $(document).height();
  13. var win_width_n = $(window).width();
  14. var popup_width = $('#adbocker_alt .popup').width();
  15. win_width_n = win_width_n - popup_width;
  16. win_width_n = win_width_n / 2;
  17. $('html, body').animate({
  18. scrollTop : 0
  19. }, 500);
  20. //$('#adbocker_alt .popup').css('left', win_width_n);
  21. $('#adbocker_alt .overlay, #adbocker_alt').css('height', win_height_n + 800);
  22. $('#adbocker_alt .popup').fadeIn();
  23. var c = $('#zedoads1').attr('data-zedoads');
  24. ga('send', 'event', 'AdblockPopup', c, 'true');
  25.  
  26. $('#adbocker_alt .close').click(function () {
  27. $(this).parent('div').fadeOut();
  28. $('#adbocker_alt .overlay').fadeOut();
  29. $('#adbocker_alt').remove();
  30. });
  31.  
  32. }
  33.  
  34. function checkAds(adsId) {
  35. var c = $('#zedoads1').attr('data-zedoads');
  36. if ($('#' + adsId).height() == 0 || $('#' + adsId).height() == '0') {
  37. ga('send', 'event', 'Adblock', c, 'true'); //ga('send','_trackEvent','WriteAdblock','true');
  38. openPopup();
  39. } else {
  40. ga('send', 'event', 'Adblock', c, 'false'); //ga('send','_trackEvent','WriteAdblock','false');
  41. }
  42. }
  43.  
  44. function checkAdsOld(adsId) {
  45. var c = $('#' + adsId).attr('data-zedoads');
  46. if (document.getElementById(adsId) != undefined) {
  47. if ($('#' + adsId).height() == 0 || $('#' + adsId).height() == '0') {
  48. ga('send', 'event', 'Adblock', c, 'true'); //ga('send','_trackEvent','WriteAdblock','true');
  49. //window.location.href = '/ad-blocker.php?ref_url='+window.location;
  50. openPopup();
  51. //alert('blocked: '+c);
  52. } //alert($('#'+adsId).height());
  53. } else {
  54. if (c != undefined) {
  55. ga('send', 'event', 'Adblock', c, 'false'); //ga('send','_trackEvent','WriteAdblock','false');
  56. // alert('open: '+c);
  57. }
  58. //ga('send', 'event', 'Test_AdDisplay', 'No',c);
  59. //ga('send', 'event', 'Adblock', 'Yes', 'AdblockYes'); alert('Yes');
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment