JavaScript
- 3 ответа
- 0 вопросов
4
Вклад в тег
var elm = document.createElement('div');
elm.style.position = 'fixed';
elm.style.padding = '5px';
elm.style.right = '0';
elm.style.zIndex = '11110';
elm.style.background = '#fff';
elm.style.boxShadow = ' 0 0 1px rgba(0, 0, 0, 0.4)';
elm.style.borderRadius = '5px 0 0 5px';
elm.innerHTML = 20;
document.body.appendChild(elm);
window.onscroll = function () {
elm.style.top = (document.documentElement.clientHeight - 36) * window.document.body.scrollTop / window.document.body.scrollHeight + 18 + 'px';
}