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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:45:44+00:00 2026-06-05T22:45:44+00:00

i got a jquery code from this link (end of page): How to scroll

  • 0

i got a jquery code from this link (end of page):
How to scroll to top of page with JavaScript/jQuery?

Why don’t you just use some reference element at the very beginning of
your html file, like

<div id="top"></div>

and then, when the page loads, simply do

$(document).ready(function(){

    top.location.href = '#top';

});

If the browser scrolls after this function fires, you simply do

$(window).load(function(){

    top.location.href = '#top';

});

now, everything is working but not in google chrome!
how i can fix this code for google chrome?
and how i can add a some animation to this code? like scroll speed or fast, slow etc…

  • 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-05T22:45:45+00:00Added an answer on June 5, 2026 at 10:45 pm

    If you’re using jQuery, you can use scrollTop to scroll. It’s a method, but it can be animated too. Here is the documentation: jQuery API Documentation for scrollTop

    You can use it like so:

    $("html,body").scrollTop(0);
    

    Or for animating:

    $("html,body").animate({scrollTop: 0}, 1000);
    

    You could set this in any event handler:

    $(document).ready(function()
    {
         $("html,body").animate({scrollTop: 0}, 1000);
    }
    

    Or:

    $(window).load(function()
    {
         $("html,body").animate({scrollTop: 0}, 1000);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i m working on jQuery accordion and i got the code from this link
I'm upgrading an app from prototype.js to jquery. I've got this code (prototype.js): var
I've got this code: <html> <head> <link type=text/css href=css/blitzer/jquery-ui-1.7.2.custom.css rel=stylesheet /> <script type=text/javascript src=js/jquery-1.3.2.min.js></script>
I got this code from Jquery in Action: $.fn.photoslide = function(options) { var settings
I got this html code from a book that i'm using to learn jquery
I've got the following code: <code><html> <body><br> <script type=text/javascript src=http://code.jquery.com/jquery-1.4.2.min.js /> <script type=text/javascript> alert(debug);
I got this code today that works for jQuery v7. The problem is that
I've got this piece of code in my jquery validation script: resetForm: function() {
I got this jQuery pre-loading script running on a index.html page loading about 10Mb
I have two pages - a simple HTML code example page from a jQuery

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.