Advertisement
clickio

Kosmetista horizontal sticky 1 time in 1 day

Sep 22nd, 2020
1,276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5.95 KB | None | 0 0
  1. <!-- Clickio 320*100 mobile sticky -->
  2. <script>
  3. (function(w){
  4.     var showTime = 1;
  5.  
  6.     function getCookie(name) {
  7.         let matches = document.cookie.match(new RegExp(
  8.             "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
  9.         ));
  10.         return matches ? decodeURIComponent(matches[1]) : undefined;
  11.     }
  12.     function setCookie(name, value, options = {}) {
  13.         if (options.expires instanceof Date) {
  14.             options.expires = options.expires.toUTCString();
  15.         }
  16.         let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
  17.         for (let optionKey in options) {
  18.             updatedCookie += "; " + optionKey;
  19.             let optionValue = options[optionKey];
  20.             if (optionValue !== true) {
  21.                 updatedCookie += "=" + optionValue;
  22.             }
  23.         }
  24.         document.cookie = updatedCookie;
  25.     }
  26.     function showCode(p, c) {
  27.         var div = document.createElement('div');
  28.         div.innerHTML = c;
  29.         p.appendChild(div);
  30.         while (div.firstChild) p.insertBefore(div.firstChild, div);
  31.         p.removeChild(div);
  32.         var scripts = p.getElementsByTagName("script");
  33.         Array.from(scripts).forEach(function(script, index, array) {
  34.             var newScript = document.createElement('script');
  35.             if(typeof script.src !== "undefined" && script.src && script.sr !== "")
  36.           {
  37.               newScript.src = script.src;
  38.                 newScript.className = script.className;
  39.                 p.appendChild(newScript);
  40.             }
  41.             else
  42.             {
  43.                 var data = (script.text || script.textContent || script.innerHTML || "");
  44.                 newScript.className = script.className;
  45.                 newScript.type = script.type;
  46.                 newScript.appendChild(document.createTextNode(data));
  47.                 p.appendChild(newScript);
  48.             }
  49.             p.removeChild(script);
  50.         });
  51.     }
  52.     var c = getCookie("lx_sticky_shown_m")
  53.     if(!c || ( c && Number.parseInt(c, 10) < showTime ) )
  54.    {
  55.        var div = document.createElement("DIV");
  56.         div.id = "lx_sticky_wrapper_m";
  57.         var b = document.querySelector("body");
  58.         b.appendChild(div);
  59.         var code = "<script async type='text/javascript' src='//s.clickiocdn.com/t/common_258.js'><\/scr" + "ipt>" +
  60.             "<script class='__lxGc__' type='text/javascript'>" +
  61.             "((__lxGc__=window.__lxGc__||{'s':{},'b':0})['s']['_214500']=__lxGc__['s']['_214500']||{'b':{}})['b']['_662320']={'i':__lxGc__.b++};" +
  62.             "<\/scr" + "ipt>";
  63.         var parent = document.querySelector("#lx_sticky_wrapper_m");
  64.         showCode(parent, code);
  65.         var date = new Date();
  66.         date.setDate(date.getDate() + 1);
  67.         date.setHours(0,0,0,0);
  68.         var cv = (c?Number.parseInt(c, 10):0) + 1;
  69.         setCookie("lx_sticky_shown_m", cv, {secure: true, expires: date});
  70.     }
  71. })(window);
  72. </script>
  73.  
  74. <!-- Clickio 320*100 desktop sticky -->
  75. <script>
  76. (function(w){
  77.     var showTime = 1;
  78.  
  79.     function getCookie(name) {
  80.         let matches = document.cookie.match(new RegExp(
  81.             "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
  82.         ));
  83.         return matches ? decodeURIComponent(matches[1]) : undefined;
  84.     }
  85.     function setCookie(name, value, options = {}) {
  86.         if (options.expires instanceof Date) {
  87.             options.expires = options.expires.toUTCString();
  88.         }
  89.         let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
  90.         for (let optionKey in options) {
  91.             updatedCookie += "; " + optionKey;
  92.             let optionValue = options[optionKey];
  93.             if (optionValue !== true) {
  94.                 updatedCookie += "=" + optionValue;
  95.             }
  96.         }
  97.         document.cookie = updatedCookie;
  98.     }
  99.     function showCode(p, c) {
  100.         var div = document.createElement('div');
  101.         div.innerHTML = c;
  102.         p.appendChild(div);
  103.         while (div.firstChild) p.insertBefore(div.firstChild, div);
  104.         p.removeChild(div);
  105.         var scripts = p.getElementsByTagName("script");
  106.         Array.from(scripts).forEach(function(script, index, array) {
  107.             var newScript = document.createElement('script');
  108.             if(typeof script.src !== "undefined" && script.src && script.sr !== "")
  109.           {
  110.               newScript.src = script.src;
  111.                 newScript.className = script.className;
  112.                 p.appendChild(newScript);
  113.             }
  114.             else
  115.             {
  116.                 var data = (script.text || script.textContent || script.innerHTML || "");
  117.                 newScript.className = script.className;
  118.                 newScript.type = script.type;
  119.                 newScript.appendChild(document.createTextNode(data));
  120.                 p.appendChild(newScript);
  121.             }
  122.             p.removeChild(script);
  123.         });
  124.     }
  125.     var c = getCookie("lx_sticky_shown_d")
  126.     if(!c || ( c && Number.parseInt(c, 10) < showTime ) )
  127.    {
  128.        var div = document.createElement("DIV");
  129.         div.id = "lx_sticky_wrapper_d";
  130.         var b = document.querySelector("body");
  131.         b.appendChild(div);
  132.         var code = "<script async type='text/javascript' src='//s.clickiocdn.com/t/common_258.js'><\/scr" + "ipt>" +
  133.             "<script class='__lxGc__' type='text/javascript'>" +
  134.             "((__lxGc__=window.__lxGc__||{'s':{},'b':0})['s']['_214500']=__lxGc__['s']['_214500']||{'b':{}})['b']['_662323']={'i':__lxGc__.b++};" +
  135.             "<\/scr" + "ipt>";
  136.         var parent = document.querySelector("#lx_sticky_wrapper_d");
  137.         showCode(parent, code);
  138.         var date = new Date();
  139.         date.setDate(date.getDate() + 1);
  140.         date.setHours(0,0,0,0);
  141.         var cv = (c?Number.parseInt(c, 10):0) + 1;
  142.         setCookie("lx_sticky_shown_d", cv, {secure: true, expires: date});
  143.     }
  144. })(window);
  145. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement