<div id=”p” onscroll=”test()” style=”width:150px; height:150px; overflow:auto;”>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <input id=”c” value=”Test” type=”button”/>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
</div>
….
What is the document.getElementById(“c”).style.top?
1)It is the distance from the upper edge of the button to the top edge of the document or
2)It is the distance from the upper edge of the button to the top edge of the parent element (id=”p”) or
something else?
3)How should I code it to do the following:
While the div (id=”p”) scrollTop, the button(id=”c”) will stay at the same position (not scrolling along).
Thanks
Scott