Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-14-2008, 01:46 AM   PM User | #1
otnj2ee
Regular Coder

 
Join Date: Apr 2007
Posts: 174
Thanks: 17
Thanked 0 Times in 0 Posts
otnj2ee is an unknown quantity at this point
How to define style.top?

<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
otnj2ee is offline  
Old 02-14-2008, 02:26 AM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,697
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
http://www.w3schools.com/css/pr_pos_top.asp
__________________
Don’t click this link!
VIPStephan is offline  
Old 02-14-2008, 06:50 AM   PM User | #3
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
64 posts? Please read the forum rules..
Quote:
Originally Posted by http://www.codingforums.com/rules.htm
# 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 )
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:06 AM.


Advertisement
Log in to turn off these ads.