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
9a557f882f
commit
896a6b570e
1 changed files with 2 additions and 4 deletions
|
@ -2237,10 +2237,8 @@ function downloadURLOrAlertError(jsonURL, data, filename) {
|
|||
}
|
||||
|
||||
function startGoogleAd(selector){
|
||||
if($(selector).is(":visible")){
|
||||
setTimeout(function(){
|
||||
if($(selector).is(":visible") && $(selector).height() >= 80 && $(selector).width() >= 200){
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
},1000);
|
||||
}else{
|
||||
setTimeout(function(){startGoogleAd(selector);},1000);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue