From b9259820fa6abbac3bc0d0bf8b113feaf21ab4f9 Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Tue, 31 Mar 2020 16:37:25 -0400 Subject: [PATCH] hide outstream div --- modules/appnexusBidAdapter.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index fc7ec77c267..c411bacd3ec 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -841,8 +841,20 @@ function buildNativeRequest(params) { return request; } +/** + * This function hides google div container for outstream bids to remove unwanted space on page. Appnexus renderer creates a new iframe outside of google iframe to render the outstream creative. + * @param {string} elementId element id + */ +function hidedfpContainer(elementId) { + var el = document.getElementById(elementId).querySelectorAll("div[id^='google_ads']"); + if (el[0]) { + el[0].style.setProperty('display', 'none'); + } +} + function outstreamRender(bid) { // push to render queue because ANOutstreamVideo may not be loaded yet + hidedfpContainer(bid.adUnitCode); bid.renderer.push(() => { window.ANOutstreamVideo.renderAd({ tagId: bid.adResponse.tag_id,