Skip to content

Instantly share code, notes, and snippets.

@alexfndr
Last active December 26, 2019 15:29
Show Gist options
  • Save alexfndr/992445a43baf885685b54277de888655 to your computer and use it in GitHub Desktop.
Save alexfndr/992445a43baf885685b54277de888655 to your computer and use it in GitHub Desktop.
pushadunits
<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