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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:17:26+00:00 2026-06-08T22:17:26+00:00

swinging the big bat here and going modern-only on a personal project. Elements are

  • 0

swinging the big bat here and going modern-only on a personal project. Elements are loaded on the page with opacity:0 and will have a class added to them that has opacity:1 and a CSS3 transition. I’m trying to cue each of the elements to fade in one after another.

Typically, I can use the below code to cue fade ins, but this uses jQuery’s .animate() method and I want higher frame rates and less CPU strain.

$('.test').each(function(i) {
    $(this).delay(i*100).animate({ opacity:1 }, 400); //CPU based!
});

Adding a class is almonst instantaneous (to us humans) and therefore the effect doesn’t do all that much.

$('.test').each(function(i) {
    $(this).delay(i*100).addClass('show'); //instant coffee!
});

The goal then is setting a timeout after the class is added so that it effectively takes the same time the original animation would. And herein lies my problem: The setTimeout() method can only be run on the window…

$('.test').each(function(i) {
    $(this).delay(i*100).setTimeout(function(){ //doesn't work!
        $(this).addClass('show');
    }, 400);
});

How can I delay each elements function and give the addClass() method some hang time?

$('.test').each(function(i) {
    var test = $(this);

    test.delay(i*100,function(){ //I wish!
        setTimeout(function(){
            test.addClass('show');
        },400);
    });
});
  • 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-08T22:17:28+00:00Added an answer on June 8, 2026 at 10:17 pm

    Try the following:

    $('.test').each(function(i) {
        var ind = i * 100;
        var test = $(this);
        setTimeout(function(){ 
            test.addClass('show');
        }, ind);
    });
    

    or:

    var $tests = $('.test')
    var len = $tests.length;
    var i = 0;
    var test =  setInterval(function(){
                    $tests.eq(i).delay(i*100).queue(function(){
                      $(this).addClass('show')
                    })   
                    i++;
                    if (i == len) {
                        clearInterval(test)
                    }
                 }, 400)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the setup: I have an Open Source project called Massive and I'm slinging
I have an interesting challenge that I'm wondering if anyone here can give me
I'm new to IOS programming, I don't know how to judge the swinging direction
Swinging ropes are commonly found in platform video games where the player jumps on
I'm going slightly mad (singing Queen's song) about records with Generic Containers (TList). First,
Here is my scenario. I'm am HTML/CSS guy, JavaScript not so much. But this
I have an application that is very connection-based, i.e. multiple inputs/outputs. The UI concept
I have a few questions regarding use-case diagram: If my system has register/login use-case
I have just updated my Xcode to X.Y.Z. Now I have a problem with
I have the following Spring code, taken from a textbook, that's returning a NotWritablePropertyException.

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.