Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     <div class="left-ad-slot-container">
  2.         <style>
  3.             .ad_unit_left {
  4.                 width: 160px;
  5.                 height: 600px;
  6.                 position: fixed;
  7.                 left: 0;
  8.                 top: calc(50% - 300px);
  9.                 display: none;
  10.                 z-index: 9999;
  11.             }
  12.         </style>
  13.         <script>
  14.             if (typeof document.body.clientWidth !== 'undefined' && document.body.clientWidth > 1099) {
  15.  
  16.                 jQuery(".close").click(function() {
  17.                     jQuery(".ad_unit_left").addClass("hide")
  18.                 });
  19.  
  20.                 var top_show = 200;
  21.                 var delay = 500;
  22.                 var window_width = jQuery(window).width();
  23.                 if (window_width > 900) {
  24.                     jQuery(window).scroll(function() {
  25.                         if (jQuery(this).scrollTop() > top_show) {
  26.                             jQuery('.ad_unit_left').fadeIn();
  27.                         } else {
  28.                             jQuery('.ad_unit_left').fadeOut();
  29.                         }
  30.                     });
  31.                 }
  32.             }
  33.         </script>
  34.         <div class="ad_unit_left">
  35.             <div class="close">x</div>
  36.             <!-- ad 160x600 -->
  37.         </div>
  38.     </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement