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
    180
    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. #2
    Administrator VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    10,728
    Thanks
    6
    Thanked 1,277 Times in 1,247 Posts

  3. #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    15,060
    Thanks
    165
    Thanked 2,250 Times in 2,237 Posts
    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? )


 

Posting Permissions

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