mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Run ads only when container is visible
This commit is contained in:
parent
896a6b570e
commit
3d2585344c
1 changed files with 2 additions and 1 deletions
|
@ -2238,7 +2238,8 @@ function downloadURLOrAlertError(jsonURL, data, filename) {
|
|||
|
||||
function startGoogleAd(selector){
|
||||
if($(selector).is(":visible") && $(selector).height() >= 80 && $(selector).width() >= 200){
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
setTimeout(function(){(adsbygoogle = window.adsbygoogle || []).push({});},2000);
|
||||
|
||||
}else{
|
||||
setTimeout(function(){startGoogleAd(selector);},1000);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue