Js
<! DOCTYPE html>
Point one: Document.documentElement.clientWidth | | Document.body.clientWidth; Gets the width of the visible area.
Behind is chrome-compatible. The front is compatible with other browsers.
Point two: OTop.style.left = screenw-otop.offsetwidth + "px"; When the page loads. Position the element at the far right of the page. Subtracts the width of the element itself with the width of the visible area.
Point three: OTop.style.top = screenh-otop.offsetheight + scrolltop + "px"; When the page scrolls, the y-coordinate position of the element is equal to the height of the visible area minus the height of the element itself, plus the scrolling distance.
Point four: document.documentElement.scrollTop = Document.body.scrollTop = 0; When the element is clicked. Make the page scroll distance of 0. write two for compatibility.
Jquery
JS and jquery implement back to the top level