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

  • Home
  • SEARCH
  • 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 7490533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:40:19+00:00 2026-05-29T15:40:19+00:00

I have a problem with the scrollTop jquery animation. It micro-jumps right before the

  • 0

I have a problem with the scrollTop jquery animation.
It micro-jumps right before the animation. The heavier the content is, worst it is.

I don’t understand why does it do that…

Below, a sample of my code. (just copy/paste on file, it’s a standalone code, I hadn’t good result on jsfiddle)

<html>
<head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
<body>
<style>
html,body{height:100%;width:100%}body{width:100%;height:100%}section{display:block;width:896px;margin:0 auto;padding:0 48px}article{content:' ';position:relative;display:block;top:0;width:100%;height:500px;padding:20% 0}#ghostPage{height:30px;padding:0}section div{text-align:center;width:100%;height:100%}#page1 div{background-color:red}#page2 div{background-color:blue}#page3 div{background-color:#A52A2A}#page4 div{background-color:green}#page5 div{background-color:#FF0}#page6 div{background-color:#000}#page7 div{background-color:orange}#page8 div{background-color:purple}#page_loader{text-align:center;position:fixed;top:0;left:0;background-color:white;width:100%;height:100%;z-index:9999}
</style>
<section class="clearfix">
    <div id="page_loader" class="loader1"></div>
    <article id="page1">
        <div>Page1</div>
    </article>
    <article id="page2">
        <div>Page2</div>
    </article>
    <article id="page3">
        <div>Page3</div>
    </article>
    <article id="page4">
        <div>Page4</div>
    </article>
    <article id="page5">
        <div>Page5</div>
    </article>
    <article id="page6">
        <div style="color: white">Page6</div>
    </article>
    <article id="page7">
        <div>Page7</div>
    </article>
    <article id="page8">
        <div>Page8</div>
    </article>
    <article id="ghostPage"></article>
</section>
</body>
<script type="text/javascript">
/*
**
** Sliding
**
*/
function goToByScroll(id) {
    var speed = 1200;

    var offset = $('#page'+id).offset();
    if (offset) {
        $('body').stop().animate({scrollTop: offset.top},{duration: speed, queue: false});
        window.location = '#page'+id;
    }
}

/*
**
** Get current page id
**
*/
function getPageId() {
    var url = document.location.toString();
    if (url.match('#')) {
        var anchor = url.split('#')[1];
        var anchorId = parseInt(anchor.split('page')[1]);
        if (!isNaN(anchorId))
            return anchorId;
    }
    return 1;
}

/*
**
** MouseWheel handling
**
*/
function handle(delta) {
    if (delta > 0)
        goToByScroll(getPageId() - 1);
    else if (delta < 0)
        goToByScroll(getPageId() + 1);
}

function wheel(event){
    event.preventDefault();
    event.stopPropagation();

    var delta = 0;
    if (event.wheelDelta)
        delta = event.wheelDelta/120;
    else if (event.detail)
        delta = -event.detail/3;

    if (delta)
        handle(delta);
}
if (window.addEventListener)
    window.addEventListener('DOMMouseScroll', wheel, false);
window.onmousewheel = document.onmousewheel = wheel;

/*fades le loader mask out*/
$(document).ready(function() {
    $('#page_loader').css('background-image', 'none');
    $('#page_loader').css('background-color', 'rgba(255, 255, 255, 0)').animate('slow', function(){$('#page_loader').css('z-index', '-9999');});
});
</script>
</html>

The content is not that heavy so it’s hard to see the bug. Firefox make it easier to see and quick scrolling too.

I’m waiting your good advises. 🙂

  • 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-29T15:40:20+00:00Added an answer on May 29, 2026 at 3:40 pm

    ok, the problem is this line: window.location = '#page' + id;
    by changing the hash-tag the page jumps to the specified element, then the jQuery kicks in and animates to the same ID. I tried around a little and my final version is this: http://jsfiddle.net/h6CS4/6/
    though it’s not great…

    try this plugin instead of re-inventing the wheel: http://flesler.blogspot.com/2007/10/jqueryscrollto.html

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

Sidebar

Related Questions

I have a problem with following jquery code if ($(window).scrollTop() >= ($(document).innerHeight() - $(window).innerHeight()))
I'm loading successfully external content to my div with Jquery, the only problem is
I have a problem with this jQuery script: What I want to do is
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with ActionLink. I'd like to pass to my ActionLink parameter for
I have problem when I try insert some data to Informix TEXT column via
I have problem creating new instance of excel 2007 using VBA (from Access 2002).

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.