Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marker1k/07c24b7a3a551a5ed3c7d5df1135138c to your computer and use it in GitHub Desktop.
Save marker1k/07c24b7a3a551a5ed3c7d5df1135138c 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() {
var adfoxBiddersMap = {
"buzzoola": "1224359"
};
var adUnits = [{
"codeType": "inpage",
"code": "adfox_152725011687362923",
"bids": [{
"bidder": "buzzoola",
"params": {
"placementId": "563737"
}
}]
}];
window.Ya.headerBidding.pushAdUnits([{
code: 'adfox_152725011687362923',
sizes: [
[728, 90]
],
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') }
});
}
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