Using FireFox 19.0.2
I have noticed that when I set .scrollTop = 0, the content is indeed loaded showing the top of the content.
However the scroll bar, is left at the location where it was when last viewed.
How can I make sure that both the content and the scroll bar (slider) are set to 0 (top of container)?
The content is contained in a <div> tag. Within the container is a table that exceeds the max height of the container.
I have noticed that when I set .scrollTop = 0, the content is indeed loaded showing the top of the content.
However the scroll bar, is left at the location where it was when last viewed.
How can I make sure that both the content and the scroll bar (slider) are set to 0 (top of container)?
The content is contained in a <div> tag. Within the container is a table that exceeds the max height of the container.
Code:
<div
id="scratchPad"
style=" position:relative;
top:25px;
margin-left:auto;
margin-right:auto;
border:5px ridge #ff6600;
padding:7px;
background-color: #ccffcc;
background-image:linear-gradient(to top, #ccff99 0%, White 100%);
height:75%;
width:65%;
visibility:hidden;
overflow: scroll;
z-index: 101;"
>
<table style="display: flex;margin: auto;opacity:0.85;">
document.getElementById("scratchPad").scrollTop = 0;
document.getElementById("scratchPad").style.visibility = "visible";
Comment