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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:35:07+00:00 2026-05-25T23:35:07+00:00

I’m making mock ups for a flash app using HTML pages – I’m using

  • 0

I’m making mock ups for a flash app using HTML pages – I’m using HTML pages to demonstrate it inside a browser, plus it looks better pixel for pixel, and I’m using jQuery for rich animations on some pages.

I’m using normal <a> tags for my buttons which navigate through the HTML pages.

But if I have scrolled halfway down the page and click on a button at the bottom of the page – when it goes to the next HTML page it jumps back to the top of the page – this is obviously going to happen.

Is there any javascript or tricks that can prevent all <a> tags from jumping to the top of the page when navigating though my HTML pages. Or even better, if I could give my <a> tags a class so it doesn’t interfere with my jQuery animations – because some use <a> tags.

My html pages are like so:

page-1.html
page-2.html
page-3.html
page-4.html
page-5.html

I’m not actually using jQuery or JavaScript to navigate through my pages, so when it jumps to page-2.html from page-1.html – it always jumps to top.

My <a> tags are using full href’s <a href="page-2.html" class="stop-jumping" title="Page 2"><img ... /></a>

I’m looking for something to include in the head of every HTML page to stop my page from moving when navigating using <a> tags.

  • 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-05-25T23:35:07+00:00Added an answer on May 25, 2026 at 11:35 pm

    I assume your a tag doesn’t have a proper href attribute and you just put "#" in it (which is bad from a semantic and usability point of view).

    Your browser is thinking you’re clicking on an anchor, try to find it in the DOM, fail and then brings you back to the top of the page.

    A way to avoid that is to bind a function on the click event of your a tags and call preventDefault()

    $("a").click(function(event) {
      event.preventDefault();
    }
    

    See the jQuery doc.


    Edit due to huge edit on question

    You need to use HTML anchor. On each of your html pages, give an id on the element you want your users screen to be aligned on.

    <h1 id="the_place">The user screen will be aligned to this element</h1>
    

    And on every link that leads to another page, add #the_place on the end of the href attribute

    <a href="/page-2.html#the_place">Go to page 2</a>
    

    That should do it =).

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.