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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:30:43+00:00 2026-05-20T02:30:43+00:00

i’m working on some kind of twitter new ticker using jquery and i’m stuck

  • 0

i’m working on some kind of twitter new ticker using jquery and i’m stuck on a visual effect. I have all the tweets i want to show formatted as strings stored into an array.
The strings are like this:

<p><a href="http://twitter.com/user">user</a>: tweet text</p>

I would like to have the paragraph added to the container DIV one at a time, with some kind of fade in effect, like the one you get in the example when you click on the button:
http://jsbin.com/uneso (example is from here).

I’ve tried using the code from the example and i wrote this:

for (i=0; i<tweetsArray.length; i++){
var tweetTmp = tweetsArray[i];
$(displayContainer).append(tweetTmp).fadeIn("slow");
}

But it looks like all the appends get done together and then one single fadeIn() effect is applied to the whole div.

Any idea why it does behave like this?

Thanks in advance,
Marcello

P.S. I’ve tried looking at this too but i still couldn’t solve my problem.

  • 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-20T02:30:44+00:00Added an answer on May 20, 2026 at 2:30 am

    Your code is looping through without waiting for the fades to occur. If you want to wait for each fade to occur before appending the next div, you’ll need to either use the fadeIn completion callback (my preferred solution) or delay adding them (the favorite of some others I respect).

    Here’s are rough examples:

    Using the completion callback:

    var tweetArray = [
      "This is tweet 1",
      "This is tweet 2",
      "This is tweet 3",
      "This is tweet 4"
      ];
    
    $("#btnGo").click(function() {
      appendAndFade(document.body, tweetArray);
    });
    
    function appendAndFade(parent, tweets) {
      var index;
    
      index = 0;
      doOne();
    
      function doOne() {
        if (index < tweets.length) {
          $("<p>")
            .html(tweets[index++])
            .hide()
            .appendTo(parent)
            .fadeIn(doOne);
        }
      }
    }
    

    Live copy

    Note how we use the callback on fadeIn to trigger the next append-and-fade-in (doOne).

    Using delay:

    var tweetArray = [
      "This is tweet 1",
      "This is tweet 2",
      "This is tweet 3",
      "This is tweet 4"
      ];
    
    $("#btnGo").click(function() {
      appendAndFade(document.body, tweetArray);
    });
    
    function appendAndFade(parent, tweets) {
      var index;
    
      for (index = 0; index < tweets.length; ++index) {
          $("<p>")
            .html(tweets[index])
            .hide()
            .delay(index * 400)
            .appendTo(parent)
            .fadeIn(400);
      }
    }
    

    Live copy

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I am reading a book about Javascript and jQuery and using one of the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.