/    Sign up×
Community /Pin to ProfileBookmark

How to position the scroll bar

Hi everybody !
I have a web page with lots of text box , how can I position the scroll bar equal to the text box ‘s top pos. please see the attachment picture for more details . Now I can :

  • get the scroll bar total height

  • get and set the scroll bar position

  • calculate the text box’s top position (elem pos in the picture)

  • calcualte the the browser’s screen height
  • but I cant figure out the relationship between these factors ? , try lot of calculation between these factors but not seem to work 😡

    [url]http://www.webdeveloper.com/forum/attachment.php?attachmentid=7622&stc=1[/url]

    [upl-file uuid=faa99d70-d09c-4bd5-bac9-abb634a6250d size=28kB]scrollPos.jpg[/upl-file]

    to post a comment
    JavaScript

    0Be the first to comment 😎

    ×

    Success!

    Help @Whoknow spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.2,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,
    )...