1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Run ads only when container is visible

This commit is contained in:
Daniel 2022-02-09 12:52:27 -03:00
parent 214e4170c2
commit 97d6a215f8
2 changed files with 10 additions and 2 deletions

View file

@ -2234,4 +2234,12 @@ function downloadURLOrAlertError(jsonURL, data, filename) {
}
}
});
}
function startGoogleAd(selector){
if($(selector).is(":visible")){
(adsbygoogle = window.adsbygoogle || []).push({});
}else{
setTimeout(function(){startGoogleAd(selector);},1000);
}
}