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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:12:21+00:00 2026-05-30T12:12:21+00:00

I have an image that I will use as the button. I need some

  • 0

I have an image that I will use as the button. I need some code that will make the page scroll smoothly down 400px every time the image is clicked.

I think JQuery or Javascript would do the trick, I am not really sure because I do not know them.

It would be even better in fact, if instead of button, I could just have a keyboard shortcut. Just like Google on Google+, “J” and “K” are used to move up and down the posts. This is exactly what I am trying to achieve. Every post in my site will be the same height so that might make it easier to code.

  • 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-30T12:12:22+00:00Added an answer on May 30, 2026 at 12:12 pm

    Just bind an animate function to the click event of your image or button and let it animate the scrollTop property with 400.

    For example, place this button on your page:

    <input type="button" value="Scroll" id="scroll" />
    

    And use this piece of JavaScript:

    $('#scroll').click(function() {
        $('body').animate({scrollTop: +400}, 1000);
    })
    

    Just make sure jQuery is loaded and it will work.

    Load jQuery by adding this just before the body end tag:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    

    And the best way to include the JavaScript snippet is to place the following between the script rule above and the body end tag.

    <script type="text/javascript">
    $(document).ready(function() {
        $('#scroll').click(function() {
            $('body').animate({scrollTop: +400}, 1000);
        })
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image file that has all the character sprites that I will
I my working on the site that will have image gallery. Designer idea was
I have some static resources (images and HTML files) that will be localized. One
I have an image that, depending on the screen resolution, drops down out of
All i wanted was to create a button that in some cases will contain
I have a null pointer on a button that I need to take me
So, I have a DIV full of four HTML buttons that use an image
I develop a game that will have to load jpg images that now i
I have a view that will be displaying downloaded images and text. I'd like
i have an image that contains a series of images, e.g.: In the olden

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.