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 8400185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:29:54+00:00 2026-06-09T21:29:54+00:00

I have a table of items. Each item has detail. The table alternates between

  • 0

I have a table of items. Each item has detail. The table alternates between the item name and the item detail. I give each item row an “item-name” class and each item detail row an “item-detail” class. When the page loads, I hide all of the item-detail rows so that only the item-name rows are visible.

When the user clicks on an item-name row, it shows (expands) the item-detail below that row. If the user clicks a different item-name, it closes the open item-detail and opens the item-detail that corresponds to the new item clicked.

I want the page to scroll to the item-name that is clicked, much in the same way anchor tags can be used to move to different parts of a page. Right now, if a user clicks on an item name that has a lot of text in an item-detail, the user may have to scroll down to read it all. If the user then clicks the next item-name, it will close the above item-detail and open the new item-detail. But because the first item-detail was so long, the new item-name and item-detail are actually above the window’s scrolled view. They are expanding right below the previous item, but the user has previously scrolled below this point.

I considered naming all of the item-name rows and using jquery to call name using an anchor tag of sorts, but this seems suboptimal.

Is there jquery that would refocus the window such that the clicked item-name is at the top of the page?

  • 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-09T21:29:55+00:00Added an answer on June 9, 2026 at 9:29 pm

    This should work:

    $('.dropdown').click(function() {
        //drop down code
        var destination = $(this).offset().top;
        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have here a list of items in a table. Each item has a
I have a simple table structure where each item row has a status. What
I have a 4 column table of products in template,each item in table has
Imagine you have a normal table view where each row is an item on
I have a table of items. item has id, score 1, score 2. I
I have a list of items and each item has a checkbox attached to
I have 2 tables: users and items. Each item has a user#. So, if
I have a listing of items on a site. Each item has several categories
I have a table of items, each of which has a date associated with
I have a table full of items that each have a unique ItemID .

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.