Advertisement
clickio

mixnews.lv adfox mobile sticky

Jan 14th, 2022
856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.38 KB | None | 0 0
  1. <!-- CLICKIO AdFox sticky unit -->
  2. <style>
  3.     :root {
  4.         --lx-bg-color: #fff;
  5.         --lx-cross-color: #000;
  6.     }
  7.  
  8.     #adfox_sticky {
  9.         width: 100%;
  10.         max-height: 104px;
  11.         padding-top: 4px;
  12.         z-index: 2147483647;
  13.         position: fixed;
  14.         bottom: 0px;
  15.         left: 0;
  16.         background: var(--lx-bg-color);
  17.         text-align: center;
  18.         transition: 300ms ease-in;
  19.         line-height: 0px;
  20.         box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2) !important;
  21.     }
  22.  
  23.     #adfox_sticky #lx_close_button {
  24.         position: absolute;
  25.         width: 44px;
  26.         height: 30px;
  27.         top: -30px;
  28.         left: 0px;
  29.         background-size: 13px 13px;
  30.         background-position: 9px;
  31.         background-color: var(--lx-bg-color);
  32.         background-repeat: no-repeat;
  33.         box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.2);
  34.         border: none;
  35.         border-radius: 0 12px 0 0;
  36.         outline: none;
  37.         font-family: verdana;
  38.         font-size: 0px;
  39.         color: var(--lx-cross-color);
  40.     }
  41.  
  42.     #adfox_sticky #lx_close_button:before {
  43.       content: "";
  44.       display: inline-block;
  45.       width: 10px;
  46.       height: 10px;
  47.       transform: rotate(-45deg);
  48.       border-left: 2px solid var(--lx-cross-color);
  49.       border-bottom: 2px solid var(--lx-cross-color);
  50.       position: relative;
  51.       top: -3px;
  52.     }
  53.     #adfox_sticky #lx_close_button span {
  54.       width: 28px;
  55.       height: 28px;
  56.       line-height: 28px;
  57.       text-align: center;
  58.       display: block;
  59.       position: relative;
  60.       color: var(--lx-cross-color);
  61.       z-index: 1;
  62.     }
  63.  
  64.     #adfox_sticky #lx_noclick {
  65.     position: absolute;
  66.     top: -55px;
  67.     left: 0px;
  68.     height: 85px;
  69.     width: 66px;
  70.     }
  71. </style>
  72.  
  73. <div id="adfox_sticky">
  74.     <div id="lx_noclick"></div>
  75.     <button id="lx_close_button"></button>
  76.     <div id='adfox_164215964891492420'></div>
  77. </div>
  78. <script>
  79. (function(w) {
  80.     var refreshContainer = function(){
  81.         setTimeout(function(){ w.Ya.adfoxCode.reload('adfox_164215964891492420'); }, 30000);
  82.     };
  83.  
  84.     w.yaContextCb.push(()=>{
  85.         Ya.adfoxCode.createScroll({
  86.             ownerId: 257193,
  87.             containerId: 'adfox_164215964891492420',
  88.             params: {
  89.                 pp: 'biwg',
  90.                 ps: 'djlk',
  91.                 p2: 'hbhw'
  92.             },
  93.             onRender: function() { refreshContainer(); },
  94.             onError: function(error) { refreshContainer(); },
  95.             onStub: function() { refreshContainer(); }
  96.         }, ['phone'],{
  97.           tabletWidth: 1024,
  98.           phoneWidth: 767,
  99.           isAutoReloads: false
  100.         })
  101.     });
  102. })(window);
  103. </script>
  104. <script>
  105.     (function(){
  106.         var lxAdUnit      = document.querySelector("#adfox_sticky");
  107.         var lxCloseButton = document.querySelector("#lx_close_button");
  108.  
  109.         function lxCloseUnit() {
  110.             while (lxAdUnit.hasChildNodes()) {
  111.                 lxAdUnit.removeChild(lxAdUnit.lastChild);
  112.             }
  113.         }
  114.  
  115.         lxCloseButton.onclick = lxCloseUnit;
  116.  
  117.         var noClick = document.querySelector("#adfox_sticky #lx_noclick");
  118.  
  119.         function lxNoClickHndlr(e) {
  120.             e.preventDefault();
  121.             e.stopPropagation();
  122.             return false;
  123.         }
  124.  
  125.         noClick.addEventListener("click", lxNoClickHndlr);
  126.  
  127.     })();
  128. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement