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:
parent
214e4170c2
commit
97d6a215f8
2 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue