mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
Run ads only when container is visible
This commit is contained in:
parent
b2c2e8f945
commit
e98130e67d
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue