mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 02:09:22 +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){
|
function startGoogleAd(selector){
|
||||||
if($(selector).is(":visible")){
|
if($(selector).is(":visible") && $(selector).height() >= 80 && $(selector).width() >= 200){
|
||||||
setTimeout(function(){
|
|
||||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||||
},1000);
|
|
||||||
}else{
|
}else{
|
||||||
setTimeout(function(){startGoogleAd(selector);},1000);
|
setTimeout(function(){startGoogleAd(selector);},1000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue