...

View Full Version : How to define style.top?



otnj2ee
02-14-2008, 02:46 AM
<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

VIPStephan
02-14-2008, 03:26 AM
http://www.w3schools.com/css/pr_pos_top.asp

abduraooft
02-14-2008, 07:50 AM
64 posts? Please read the forum rules..

# 1.2) Do not crosspost- CodingForums.com is divided into various categories. When initiating a thread, always locate the most appropriate category, and post your question only ONCE, in that category. Do not post the same question in multiple categories.
(http://www.codingforums.com/showthread.php?t=133262 )



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum