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

  • Home
  • SEARCH
  • 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 9222607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:52:21+00:00 2026-06-18T03:52:21+00:00

How to pass a function to another function and call it in that other

  • 0

How to pass a function to another function and call it in that other script in specific moment?
For example I would like to do something like this:

var interval;   
var parallaxElements = function(elementSet,operacija){
    clearInterval(interval);
    var parallax = [];
    if(elementSet!=null){
        elementSet.find(".parallax").each(function(index) {
            parallax.push($(this));
        }); 
    }   
    parallaxTiming = 30;
    parallax = _.shuffle(parallax);

    interval = setInterval(function(){
        var elem = parallax.shift();        
        if(typeof(elem)!="undefined"){
             elem.stop().transition({
                y: "0px",
                z: "0px",
                duration:"850ms"
             })  
        }else{
            clearInterval(interval);

THIS IS WHERE I EXPECT THE PASSED FUNCTION TO BE CALLED

            return operacija;
            };          
        }, parallaxTiming); 
    }

And then to call the function like this:

parallaxElements(container,function(){ alert(123); });

Any help will be more then usefull. Thanks in advance for all answers.

  • 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-18T03:52:22+00:00Added an answer on June 18, 2026 at 3:52 am

    Just call operacija().

    Little demo code:

    var foo = function(operacija) {
    
      interval = setInterval(function(){
        clearInterval(interval);
        return operacija();
      }, 1000);
    };
    
    foo(function() { alert("123"); } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to pass a function as a template argument to another function
i'm trying to pass a string from main to another function. this string is
I'm trying to pass a function as an argument and call that function within
I have a C function that the doxygen looks like this: long function( classA
I want to pass a function to another function. I think functions being passed
I want to know how to pass structures to another function and subsequently access
How do you pass all the parameters of one function into another function a(){
When I pass a function (let's call it f ) into my Base function
I'm learning javascript. I know we can pass a function to other functions after
I have a function that makes an ajax call to get the initial data

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.