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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:33:21+00:00 2026-06-08T21:33:21+00:00

I am trying to create a text animation; the idea is some texts will

  • 0

I am trying to create a text animation; the idea is some texts will move to left side from right and fade away after five seconds.

I have developed the following code and it is working fine. jsfiddle But the problem is when I have multiple spans with texts, I don’t know how to show them individually.

HTML

<span class="magic" >Magic1</span>

Jquery

<script>

var left = $('.magic').offset().left;
$(".magic").css({left:left}).animate({"left":"0px"}, 2000);
$(".magic").fadeOut(3000); 

</script>

CSS

<style>
.magic {
width: 50px;
height: 50px;
position: absolute;
top: 0;
right: 0;

}
</style>

I have multiple texts like following, could you please show me how to display/animate them one by one and start the animation from the very beginning when it ends?

<span class="magic" >Magic1</span>
<span class="magic" >magic2</span>
<span class="magic" >magic3</span>
// unlimited

​
Thanks in Advance 🙂

  • 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-08T21:33:22+00:00Added an answer on June 8, 2026 at 9:33 pm

    You have errors in your markup, but aside from that, you can use recursion and a callback pattern:

    UPDATE 2 (with credit to @Madbreaks):: http://jsfiddle.net/JZzdp/6/

    var magic = $('.magic'),
    i = 0,
    len = magic.length,
    left = $('.container').width(); //SET THIS TO WHATEVER PARENT CONTAINER YOU ARE SLIDING INSIDE
    
    var slide = function(){
      magic.each( function( i ){
        $( this ).delay( i*5000 ).fadeIn().animate({"right":"+="+left},2000, function(){
          $( this ).fadeOut(3000).animate({ "right":"-="+left }, 0, function(){
            if( i === len - 1 ){ slide(); }
          });
        });
      });
    }
    slide();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Cross-post http://perlmonks.org/index.pl?node_id=979710 I'm trying to create a text file from some XML using Perl
I am trying to create a rich text editor. I have created some buttons
I am trying to create an animation using jquery by where the text shoots
I'm trying to create a simple animation in which a block of text drops
I am trying to create an animation in which a circle will be containing
I'm trying to create an animation which will slide a textview out to the
I am trying to create a simple appplication that can read from a text
I'm trying to create a text box using the vales retrieved from the database.
I'm trying to create an animation for text on a page that, every few
I'm trying to create a UITable in which the cells display some text and,

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.