Answer the question
In order to leave comments, you need to log in
How to make the "Adaptive block of Yandex.Direct" adaptive?
There is an instruction - https://yandex.ru/support/partner/products-direct/... I load the
banner asynchronously:
<!-- R-NNNNNN-NN Яндекс.RTB-блок -->
<div id="yandex_ad_R-NNNNNN-NN"></div>
<script type="text/javascript">
(function(w, d, n, s, t) {
w[n] = w[n] || [];
w[n].push(function() {
Ya.Context.AdvManager.render({
blockId: "R-NNNNNN-NN",
renderTo: "yandex_ad_R-NNNNNN-NN",
async: true
});
});
t = d.getElementsByTagName("script")[0];
s = d.createElement("script");
s.type = "text/javascript";
s.src = "//an.yandex.ru/system/context.js";
s.async = true;
t.parentNode.insertBefore(s, t);
})(this, this.document, "yandexContextAsyncCallbacks");
</script>
@media screen and (orientation: landscape) {
#yandex_ad_R-NNNNNN-NN {
width: 480px;
height: 134px;
}
}
@media screen and (orientation: portrait) {
#yandex_ad_R-NNNNNN-NN {
width: 320px;
height: 200px;
}
}
Answer the question
In order to leave comments, you need to log in
Set a variable with a directive code.
And call the variable on resize.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question