| document.getElementById("console").appendChild(document.createTextNode(message + "\n")); |
| <p>In this test, we set a new scrollTop for a scrolling div, and then we make the div display:none. The test ensures that when we bring the div back by giving it a display value of block, that we also restore its scroll position. The test also ensures that we are able to set a new scrollTop value of 0 after that.</p> |
| <div id="scroller" style="height: 20px; overflow: scroll;"> |
| <div style="height: 60px;"></div> |
| a = document.getElementById('scroller'); |
| a.style.display = 'none'; |
| a.style.display = 'block'; |
| log('scrollTop after restoring div: ' + a.scrollTop + '\n'); |
| log('scrollTop after setting scrollTop back to 0: ' + a.scrollTop + '\n'); |