<div id="USD"> 00,0000 руб.</div>
<divid="EUR">0,0000 руб.</div>
function CBR_XML_Daily_Ru(rates) {
function trend(current, previous) {
if (current > previous) return '<span class="plus-cbr"></span>';
if (current < previous) return '<span class="minus-cbr"></span>';
return '';
}
var USDrate = rates.Valute.USD.Value.toFixed(4).replace('.', ',');
var USD = document.getElementById('USD');
USD.innerHTML = USD.innerHTML.replace('00,0000', USDrate);
USD.innerHTML += trend(rates.Valute.USD.Value, rates.Valute.USD.Previous);
var EURrate = rates.Valute.EUR.Value.toFixed(4).replace('.', ',');
var EUR = document.getElementById('EUR');
EUR.innerHTML = EUR.innerHTML.replace('00,0000', EURrate);
EUR.innerHTML += trend(rates.Valute.EUR.Value, rates.Valute.EUR.Previous);
}
<script src="//www.cbr-xml-daily.ru/daily_jsonp.js" async></script>
/*типа запрет ротации моб устройства*/
@media only screen and (min-width: 415px) and (max-width: 1279px) {
body{display:none} html:before{content:'Переверните устройство в портретный режим или откройте сайт с компьютера.';position:fixed;top:0;left:0;right:0;bottom:0;margin:auto;background:#fff;z-index:999;text-align:center;width:80%;height:100px}
}
// Получаем координаты элемента относительно вьюпорта,
// https://developer.mozilla.org/ru/docs/Web/API/Element/getBoundingClientRect
const elementCoordinates = document.querySelector('.YOUR_CLASS'). getBoundingClientRect();
// Высчитываем скролл вьюпорта
const windowScroll = window.pageYOffset || document.documentElement.scrollTop;
window.scrollTop = elementCoordinates.top + windowScroll;
<script>
$(document).on('click', '#close_vid', function() {
jQuery("iframe").each(function() {
jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*')
});
});
</script>
<script>
$(document).on('click', '#play_video', function() {
jQuery("iframe").each(function() {
jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*')
});
});
</script>