Last active
December 26, 2019 15:29
-
-
Save alexfndr/992445a43baf885685b54277de888655 to your computer and use it in GitHub Desktop.
pushadunits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
#adfox_152725011687362923 { | |
opacity: 0; | |
max-height: 0; | |
transition: all 0.5s; | |
} | |
#adfox_152725011687362923>div { | |
float: left; | |
clear: both; | |
} | |
</style> <script> | |
function rg_inpage() { | |
window.Ya.headerBidding.pushAdUnits([{ | |
code: 'adfox_152725011687362923', | |
codeType: 'inpage', | |
bids: [{ | |
bidder: 'buzzoola', | |
params: { placementId: '563737' } | |
}] | |
}]); | |
window.Ya.adfoxCode.create({ | |
ownerId: 5906, | |
containerId: 'adfox_152725011687362923', | |
params: { | |
pp: 'vub', | |
ps: 'cgiu', | |
p2: 'gopr', | |
slide: true, | |
visibleAfterInit: false, | |
stick: false, | |
stickTo: 'auto', | |
stickColorScheme: 'light', | |
dl: '%request.referrer%' | |
}, | |
onRender: function() { | |
setTimeout(commercialExpand, 0, 'adfox_152725011687362923', '250'); | |
window.timeMeasure.last = Date.now(); | |
console.log(window.timeMeasure.last - window.timeMeasure.first); | |
} | |
}); | |
} | |
function commercialExpand(id1, height) { | |
document.getElementById(id1).style.maxHeight = height + 'px'; | |
document.getElementById(id1).style.opacity = 1; | |
} | |
var paragraph = document.querySelectorAll(".b-material-wrapper__text p"); | |
var root = document.querySelector(".b-material-wrapper__text") | |
var div = document.createElement('div'); | |
div.id = "adfox_152725011687362923"; | |
if (root) { | |
if (paragraph.length >= 4) { | |
document.querySelector(".b-material-wrapper__text").insertBefore(div, paragraph[3]) | |
setTimeout(rg_inpage, 1000); | |
} else { | |
document.querySelector(".b-material-wrapper__text").append(div); | |
setTimeout(rg_inpage, 1000); | |
} | |
} else { | |
console.log('cannot find .b-material-wrapper__text') | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment