: AdSense responsive format resizable on the fly The AdSense responsive format sizes the advertising only on load. If the user resizes the window (from large to small), the advertising is not resized
The AdSense responsive format sizes the advertising only on load. If the user resizes the window (from large to small), the advertising is not resized (even with media queries) and keeps its initiale size. It seems that we are only allowed to display: none; it.
Is there a way (compliante with the TOS) to resize it dynamically?
If not, is it possible (TOS again) to add overflow: hidden; so that we do not see that (the right border of the parent "box"):
More posts by @Nimeshi995
2 Comments
Sorted by latest first Latest Oldest Best
You can use jQuery and resize event to reload adsense code after the user resizes the window.
$(window).resize(function(){
reloadAdsense();
});
In order to prevent a problem with Adsense TOS, make sure it is reloaded with some delay.
$(function() {
var resize;
$(window).on('resize', function() {
clearTimeout(resize);
resize = setTimeout(function() {
reloadAdsense();
}, 300);
});
});
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.