Normalisiere die Anzeigegröße und passe die Position von eingefügten Elementen im Header-Anzeigenplatzhalter an
This commit is contained in:
@@ -201,8 +201,30 @@ async function renderPropeller() {
|
||||
}
|
||||
const moved = placeholder.firstElementChild;
|
||||
if (moved) {
|
||||
// Normalize size
|
||||
moved.style.maxWidth = '100%';
|
||||
moved.style.display = 'block';
|
||||
// If provider inserted a fixed/absolute positioned element (overlays),
|
||||
// force it to behave as inline block inside our header placeholder.
|
||||
try {
|
||||
const cs = getComputedStyle(moved);
|
||||
if (cs.position === 'fixed' || cs.position === 'absolute') {
|
||||
moved.style.setProperty('position', 'relative', 'important');
|
||||
moved.style.setProperty('top', 'auto', 'important');
|
||||
moved.style.setProperty('right', 'auto', 'important');
|
||||
moved.style.setProperty('left', 'auto', 'important');
|
||||
moved.style.setProperty('bottom', 'auto', 'important');
|
||||
moved.style.setProperty('z-index', '1', 'important');
|
||||
moved.style.setProperty('width', '100%', 'important');
|
||||
moved.style.setProperty('max-width', '970px', 'important');
|
||||
}
|
||||
if (moved.tagName === 'IFRAME') {
|
||||
moved.style.width = '100%';
|
||||
moved.style.height = moved.style.height || '60px';
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('style normalize failed', e);
|
||||
}
|
||||
}
|
||||
observer.disconnect();
|
||||
try { window.dispatchEvent(new CustomEvent('ads:relocated',{detail:{provider:'propeller',zone:propSlotId}})); } catch {}
|
||||
|
||||
Reference in New Issue
Block a user