1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Run ads only when container is visible

This commit is contained in:
Daniel 2022-02-09 13:00:53 -03:00
parent b2c2e8f945
commit e98130e67d

View file

@ -2240,6 +2240,6 @@ function startGoogleAd(selector, timeout){
if($(selector).is(":visible") && $(selector).height() >= 80 && $(selector).width() >= 200){
setTimeout(function(){(adsbygoogle = window.adsbygoogle || []).push({});},timeout);
}else{
setTimeout(function(){startGoogleAd(selector);},1000);
setTimeout(function(){startGoogleAd(selector, timeout);},1000);
}
}