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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:41:39+00:00 2026-06-05T02:41:39+00:00

I have a jQuery scroll set up, but the duration is not working properly.

  • 0

I have a jQuery scroll set up, but the duration is not working properly.
On a the “About Page” of a WordPress site, I want to use jQuery so that upon click of a photo, it scrolls down to the appropriate div. The scroll is working, however, the duration is not. The scroll takes about 1/4 a second and it doesn’t matter at what speed I set the duration. The site I’m referring can be seen at: http://teamcoding.ca/corporate/about-test/

Below is the source code for the jQuery scroll.

$(function(){
    $('a[href*=.staff_photos_indiv]').click(function() {
        if (location.pathname.replace(/^\//,") == this.pathname.replace(/^\//,") && location.hostname == this.hostname) {
            var $target = $target;
            $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, {easing:'easeInOutExpo',duration:1600});
                return false;
            }
        }
    }); 
});
  • 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-05T02:41:42+00:00Added an answer on June 5, 2026 at 2:41 am

    My guess would be that you don’t have the 'easeInOutExpo' easing function defined because the general operation works with this code:

    $(document.body).animate(
        {scrollTop: "400px"}, {easing: "swing", duration: 1600}
    );
    

    And, you can see it work here: http://jsfiddle.net/jfriend00/UbnUh/

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

Sidebar

Related Questions

I want have width and height of a full div with scroll using JQuery,
I use jquery masonry + infinite scroll. I would have the preloading effect with
I have jquery validation code which is working fine in ff but the same
I have jquery with class= modal i want to call that class when page
I have a little problem with jQuery UI 's droppable component, but I'm not
First off, I don't have any knowledge about java/jquery/ajax or such, but I think
I have a HTML page that scrolls up and down (not a lot, but
I have set a background image for a mobile page with mobile.jquery. So far
I'm working on a site where I have to use a fixed DIV for
So I've got this UpdatePanel. Inside it I have a nifty little jQuery scroll

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.