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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:28:49+00:00 2026-06-11T15:28:49+00:00

Question title is confusing, I know. it also make my search hard to find

  • 0

Question title is confusing, I know. it also make my search hard to find a solution.

assume I have these codes, how can I pass parameter to complete or step when .animate() option is an external object?

var someObj = {
    onComplete: function(e) {
        console.log(e); // return undefined
    },

    onStep: function(e) {
        console.log(e); // return undefined too
    },
}

var optionObj = {
    duration: 300,
    easing: 'linear',
    complete: someObj.onComplete(e), // this is not working
    step: someObj.onStep(e) // this is not working
}

$('div').animate({width: "500px", height: "500px"}, optionObj);
  • 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-11T15:28:51+00:00Added an answer on June 11, 2026 at 3:28 pm

    To pass your own parameters to those callbacks and to ensure that this is correctly set to someObj within those callbacks you will probably need additional closures:

    var optionObj = {
        duration: 300,
        easing: 'linear',
        complete: function() {
            someObj.onComplete(e);  // assumes 'e' is defined somewhere
        },
        step: function(now, fx) {   // jQuery automatically supplies these parameters
            someObj.onStep(e);      // so you need to pass your own instead
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My title may make my question sound confusing, but it is not. I have
I know the title of this question is a bit confusing, but here it
I know the title is bit confusing for my question. Let me explain:- There
I know the title is bit confusing for my question. Let me explain:- There
Hello everybody and sorry for the rather confusing question-title. I have a Hibernate Class
The question maybe a little confusing, but it's hard to make clear this question
I know the question title may be confusing, but here is what I am
Ok so my question title may have been a little confusing. Here's my example:
Sorry if the question title is confusing. Let me explain further. I am building
Apologies for the poor question title. I have two tables, jobs and Persons-Jobs. Jobs

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.