Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. /* LAZY LOAD ADS */
  2. function lazy_ad_load (id, append_content, offset) {
  3. jQuery(document).ready(function($){
  4. if (show_var == undefined) {
  5. var show_var = []; }
  6. if (offset== undefined) {
  7. offset=2000; }
  8. if($("#" + id).length != 0){
  9. show_var[id]=0;
  10. $(window).scroll(function() {
  11. if (show_var[id]==0 && $(window).scrollTop()>$("#"+id).offset().top-offset) {
  12. jQuery("#"+id).append(append_content);
  13. show_var[id]=1;
  14. }
  15. });
  16. }
  17. });
  18. }
  19. /* END LAZY LOAD ADS */
  20.  
  21. lazy_ad_load ('content_third', '<div id=\'div-gpt-ad-1486389222273-0\' class=\"content-ads\"><script>googletag.cmd.push(function() { googletag.display(\'div-gpt-ad-1486389222273-0\'); });<\/script><\/div>', 2100);
  22. lazy_ad_load ('content_fourth', '<div id=\'div-gpt-ad-1499780497058-0\' class=\"content-ads\"><script>googletag.cmd.push(function() { googletag.display(\'div-gpt-ad-1499780497058-0\'); });<\/script><\/div>', 2100);
  23. lazy_ad_load ('content_fifth', '<div id=\'div-gpt-ad-1505381913805-0\'><script>googletag.cmd.push(function() { googletag.display(\'div-gpt-ad-1505381913805-0\'); });\r\n<\/script><\/div>', 2100);
  24. lazy_ad_load ('ads_below', '<div id=\'div-gpt-ad-1480076398305-0\' class=\"content-ads\"><script>googletag.cmd.push(function() { googletag.display(\'div-gpt-ad-1480076398305-0\'); });<\/script><\/div>', 2100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement