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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:36:37+00:00 2026-06-03T21:36:37+00:00

I have two containers, each triggers some function, which has to pass the object

  • 0

I have two containers, each triggers some function, which has to pass the object reference.
The function has nested queue and setTimeout, and I need to pas an object reference through both of them, to execute it on the right object.

This is what I tried:

 var pimg=parent.find('.prod_img'); // This is the object I actually need to pass;

    pimg.children('img:last').queue((function(aaa){
        return function() {
        whatthe= (function (itema) {
                return function() {
                 itema.children('img').each(function(){
                    alert(itema.attr('id'));
                //alert used for debug.
$(this).stop(false,false).animate({opacity:0},400,function(){
                    });
                });
                }
            })(aaa)
        aaa.data('timeout',window.setTimeout("whatthe()",   400));      
        }
    })(pimg)
    );

Now what happens is that if I trigger this function on both of my objects quickly, it would alert the same ID, which suggests that it never passes the object reference.

Note, the pimg is the actual object, it is then called aaa in queue reference, and then itema in the setTimeout reference, but they all supossed to point the same object.

Any advices are appreciated. Thanks

  • 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-03T21:36:39+00:00Added an answer on June 3, 2026 at 9:36 pm

    Your code is hurting by brain and I don’t have your HTML to actually test this, but If I understand your problem correctly, this should work:

    var pimg = parent.find('.prod_img'); // This is the object I actually need to pass;
    
    pimg.children('img:last').queue((function(aaa){
        return function() {
            var whatthe = (function (itema) {
                return function() {
                    itema.children('img').each(function(){
                        alert(itema.attr('id'));
                        //alert used for debug.
                        $(this).stop(false,false).animate({opacity:0},400, function(){});
                    });
                }
            })(aaa)
            aaa.data('timeout',window.setTimeout(whatthe, 400));
        }
    })(pimg));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two notepads and each notepad contains some data. Let's say Notepad 1
I have a file in which each line contains two numbers. The problem is
I have a table which is being dynamically populated, each row contains two textfields
Ok. I have a mainframe which contains two containers. One contains my wizard-alike buttons
I have a two divs which have class name container. Each of this divs
I have two classes (A and B) which depend on each other in following
I have a two dimensional JSON array where each element contains several attributes. The
I have these div blocks called columns where each column div contains separate two
I have a project that uses two independent Android libraries. Each of them contains
I have two div containers with content in them and two buttons outside the

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.