Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2007
    Posts
    179
    Thanks
    17
    Thanked 0 Times in 0 Posts

    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

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,662
    Thanks
    6
    Thanked 1,006 Times in 979 Posts

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    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.
    (How to define style.top? )
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •