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