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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:23:07+00:00 2026-06-12T15:23:07+00:00

I just played around a bit with the animate() method. .animate( properties [, duration]

  • 0

I just played around a bit with the animate() method.

.animate( properties [, duration] [, easing] [, complete] )

I know that I dont have to pass all the arguments to a function in javascript. But what I would like to know is how jquery figures out that function(){ } refers to the callback function, which is actually the 4:th parameter, instead of the easing string (which is the 3:rd)?

$('div').animate({ height: '10px' }, 100, function(){ });
  • 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-12T15:23:08+00:00Added an answer on June 12, 2026 at 3:23 pm

    There are simply tests to check the type :

    From the source code (animate calls speed) :

    jQuery.speed = function( speed, easing, fn ) {
        var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
            complete: fn || !fn && easing ||
                jQuery.isFunction( speed ) && speed,
            duration: speed,
            easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
        };
    
    ...
    
    isFunction: function( obj ) {
            return jQuery.type(obj) === "function";
        },
    
    ...
    
    type: function( obj ) {
            return obj == null ?
                String( obj ) :
                class2type[ core_toString.call(obj) ] || "object";
        },
    
    ...
    
    core_toString = Object.prototype.toString
    
    ...
    
    jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
        class2type[ "[object " + name + "]" ] = name.toLowerCase();
    });
    

    So basically it checks that Object.prototype.toString.call(fn) is "[object Function]".

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

Sidebar

Related Questions

Just a curiosity, I have played around with prototyping a bit, but it seems
I am really new to python, just played around with the scrapy framework that
I just played around with the new Delphi 2009 ribbon, added a few pages,
I am currently a beginner in CakePHP, and have played around with CakePHP 1.3,
Before I switched to iOS development via Monotouch I played around a bit with
I have bee at this all day. I have played around with a lot
So just getting started with Azure tables- haven't played with them before so wanted
I just found out that every time onclick event for my <button> placed inside
Just checking my JS and I have an error, but I cannot see where.
Just recently I've installed the Qt libraries on my computer, and as a complete

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.