Advertisement
Luxup

лента LUXUP + floorAd ВМа

Apr 22nd, 2024
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.   let show_topad_yandex = function () {
  3.     if (!document.documentElement.classList.contains('yandex-ad-on-screen')) {
  4.       window.yaContextCb.push(()=>{
  5.         Ya.Context.AdvManager.render({
  6.           "blockId": "R-A-5518567-2",
  7.           "type": "floorAd",
  8.           statId: 1
  9.         });
  10.       });
  11.     }
  12.   }
  13.  
  14.   let checkAndDestroyAd = function() {
  15.     if (document.documentElement.classList.contains('yandex-ad-on-screen')) {
  16.       Ya.Context.AdvManager.destroy({blockId: 'R-A-5518567-2'});
  17.     }
  18.   }
  19.  
  20.   setInterval(function() {
  21.     checkAndDestroyAd();
  22.     show_topad_yandex();
  23.   }, 2000);
  24.  
  25.   document.documentElement.addEventListener('luxupYandexFeedOnScreen', (e) => {
  26.     if (e.detail && e.detail.onScreen) {
  27.       document.documentElement.classList.add('yandex-ad-on-screen');
  28.     } else {
  29.       document.documentElement.classList.remove('yandex-ad-on-screen');
  30.       show_topad_yandex();
  31.     }
  32.   });
  33. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement