fiksna enota ohrani svojo visino: prilagajanje kreativi je 300x400 raztegnilo na 300x600
This commit is contained in:
@@ -50,6 +50,9 @@ export default function AdSense({
|
||||
// Nic se ne odreze - visina je natanko taksna kot oglas.
|
||||
let fitTimers: ReturnType<typeof setTimeout>[] = [];
|
||||
const fitToCreative = () => {
|
||||
// Enota s trdno visino v style (fiksne Display enote) se ne prilagaja
|
||||
// kreativi, sicer nam Google 300x400 razpotegne na 300x600.
|
||||
if (style && typeof (style as any).height === "string") return;
|
||||
const f = ins?.querySelector("iframe") as HTMLIFrameElement | null;
|
||||
if (!ins || !f) return;
|
||||
const h = f.getBoundingClientRect().height;
|
||||
|
||||
Reference in New Issue
Block a user