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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:43:49+00:00 2026-05-27T01:43:49+00:00

I have 6 elements on my page. A priority number is displayed next to

  • 0

I have 6 elements on my page. A priority number is displayed next to each element. I am trying to update this number after an element gets moved. But, i am having an issue with some timing of the jQuery fadeIn() fadeOut() methods. My goal is to fade out some text, update the text, then fade the text back in. The first method is doing everything i need. Although, with that method sometimes the text will change before fadeOut() has completed and looks bad. This is why i was trying to use a function for the fadeOut() method and make it change the text and execute the fadeIn() only when the fadeOut() was complete. The problem with this second method is that every element is displaying a priority of “7”. I don’t know why! Does anyone know why the second method is not working correctly?

Method #1

var priorityNumber = 1;
$("#rotatorList ul li .priority-number").each(function(){
    $(this).fadeOut(200).text(priorityNumber).fadeIn(200);
    priorityNumber = priorityNumber+1;
});

Method #2

var priorityNumber = 1;
$("#rotatorList ul li .priority-number").each(function(){
    $(this).fadeOut(200, function(){
        $(this).text(priorityNumber).fadeIn(200);
    });
    priorityNumber = priorityNumber+1;
});
  • 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-05-27T01:43:50+00:00Added an answer on May 27, 2026 at 1:43 am

    Have you tried doing this?:

        var priorityNumber =1;
       $("#rotatorList ul li .priority-number").each(function(){
            $(this).fadeOut(200, function(){
                $(this).text(priorityNumber).fadeIn(200);
                 priorityNumber = priorityNumber+1;
            });
    
        });
    

    like this http://jsfiddle.net/JUSa7/1/ fiddle (tell me if I missunderstood you)

    Another thing you could try is using the index provided by each:

    jQuery(".test").each(function(i){
        $(this).fadeOut(200, function(){
            $(this).text(i+1).fadeIn(200);
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i do. i have many html elements on page. after clicking on
I have several input and option elements on my page, each (well almost) have
I have some elements on the page. Here is example of one element: <div
i have elements like this on page <a href=#hi>go to hi</a> . . <a
I have multiple dl elements on a page. At the end of each one
We have some input elements on the page: <input type=text class=lovely-input name=number value= />
I have some elements on a page which are draggable. These same elements have
I have some the page elements split into separate visual blocks. I am currently
On extracting some html from a web page, I have some elements containing text
I have a form that when submitted successfully generates new elements on the page

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.