JSFiddle - React, Tailwind, and code Playground
HTML
<div id="acc-close-all">
<a title="Close all open tabs">Close</a>
</div>
CSS
body {
height: 1000px;
}
#acc-close-all {
position: relative;
}
#acc-close-all a {
position: absolute;
overflow: hidden;
cursor: pointer;
display: none;
}
JavaScript
// Scroll close all and bcak to top buttons with the page
$(window).scroll(function() {
var top = $(this).scrollTop();
$('#acc-close-all a').css({top: top, display: 'inline'});
});