You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are currently cases where ads can vary in height based on the content of the ads. We should likely just define the height of the ad as the maximum size it can be, given the longest text copy. If this enforce this with CSS, we should hopefully be able to provide a standard size that stops the page from jumping when the ad is loaded.
The text was updated successfully, but these errors were encountered:
If the height is specified on the <div> itself via CSS prior to any JS running that'll be the best way to ensure there's no layout shift, however in the case where the JS is blocked via an AdBlocker you potentially wind up with an empty space on the page. I addressed this by running JS after ethicalads should run (done via two scripts, and using defer instead of async) and checking if window.ethicalads is defined. If it's not I then just hide the ethicalads <div>. See: mpchadwick/mpchadwick.github.io@c0064bf
While as a publisher, I'd obviously prefer user's ad blockers aren't blocking ethicalads I still do want to give them a good experience.
One other consideration is what if the user has JavaScript disabled entirely. I slightly updated my approach to initially only apply the min-height if JavaScript is enabled mpchadwick/mpchadwick.github.io@2df4077
There are currently cases where ads can vary in height based on the content of the ads. We should likely just define the height of the ad as the maximum size it can be, given the longest text copy. If this enforce this with CSS, we should hopefully be able to provide a standard size that stops the page from jumping when the ad is loaded.
The text was updated successfully, but these errors were encountered: