Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8708151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:03:27+00:00 2026-06-13T04:03:27+00:00

I have unorder list html tag with scroll bar. based on the child selector

  • 0

I have unorder list html tag with scroll bar. based on the child selector i need to set Scorll Top value in jquery. if this below div tag is not there working fine. if div tag is there then i can not set the exate scroll top value. i need to display Test 62 on top. but out put is coming as Test 82.

<div style="height: 180px;"></div>
<ul id="ulScrollTopTest" style="height: 40px; overflow: auto;">
    <li data-id="1">Test 1</li>
    <li data-id="2">Test 2</li>
    <li data-id="3">Test 3</li>
    <li data-id="4">Test 4</li>
    <li data-id="60">Test 60</li>
    <li data-id="61">Test 61</li>
    <li data-id="62">Test 62</li>
    <li data-id="63">Test 63</li>
    <li data-id="81">Test 81</li>
    <li data-id="82">Test 82</li>
    <li data-id="83">Test 83</li>
    <li data-id="84">Test 84</li>
</ul>​

$(document).ready(function () {
    var scrollTopValue = 56;
    scrollTopValue = $('#ulScrollTopTest').find('[data-id="62"]').position().top;
    $('#ulScrollTopTest').scrollTop(scrollTopValue );
});​

Link

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:03:29+00:00Added an answer on June 13, 2026 at 4:03 am

    You should position your ul element relatively:

    <ul id="ulScrollTopTest" style="height: 40px; overflow: auto; position: relative">
    

    http://jsfiddle.net/dK95e/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have a nav element with an unorder list that I use as
I have the unorder list like so... <div class=social> <ul> <li><a href=#>Find Me <img
I have a title and a unorder list <h2> here is some interesting links
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have a list of 179 thumbnail images that I am trying to apply
have been using no DOCTYPE but rather simply starting with <html> as per HTML5
I want to create unorder list. UIwebView is good but it's very heavy (there
I have a small program that is mostly using regular set 's but now
I have got an unorderlist generated programatically using code behind, The html markup is
I have the following mark up <ul> <li>this is bullet list</li> <li>this is another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.