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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:32:49+00:00 2026-06-04T03:32:49+00:00

Possible Duplicate: jquery – disable anchor jump when loading a page I’m displaying a

  • 0

Possible Duplicate:
jquery – disable anchor “jump” when loading a page

I’m displaying a div depending on the hash value in a URL but i want to avoid the page jumping to the postion of that div with that particular ID.

I only have the problem when the page is navigated direct with the hash in the URL so say for example if someone has book marked the page.

So for example I have the url
domain.com/page.html#myitem-1

ID=myitem-1 will then display, which it does but the page then jumps down to the postion of that div which i don’t want.

I was trying to use scrollTop(0) to force the window position back to the top but it seems as if this gets called before the anchor jump takes place to has no effect

Example code:

  $(document).ready(function() {
    $('.glossary-term').hide();
    $(window.location.hash).show();

    $(window).scrollTop(0);

});

The only way i was able to get this scrollTop to work was to place it in a setTimeOut with a duration of 1, but this seems like a bit of a hack. Any other suggestions?

Thanks

B

  • 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-04T03:32:50+00:00Added an answer on June 4, 2026 at 3:32 am

    Well, if it is your internal mechanism for using anchors just for displaying divs you can always change (or remove) the “name” attribute so the browser won’t find it directly and won’t try to scroll 😉

    Otherwise try How to disable anchor "jump" when loading a page?

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

Sidebar

Related Questions

Possible Duplicate: How to access this attribute using jquery, given a div defined by
Possible Duplicate: What does jQuery.fn mean? I have some script on a page trying
Possible Duplicate: jQuery disable SELECT options based on Radio selected (Need support for all
Possible Duplicate: jQuery bind click ANYTHING but ELEMENT I have this HTML <div id=outer>
Possible Duplicate: jQuery refresh if PHP file echo's 'true' I have the following div
Possible Duplicate: Jquery IE6 hover problems, keeps loading background image. Hello I am trying
Possible duplicate: jquery change div text The above question is a possible duplicate, but
Possible Duplicate: JS/jQuery (Hide div, show div on click) I'm new to web development
Possible Duplicate: jQuery UI Slider - max value (not end of slider) I'm using
Possible Duplicate: jQuery and SEO (hidden div's) What if I added a hidden div

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.