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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:00:57+00:00 2026-06-15T04:00:57+00:00

How can I slide text out and in to replace one word in a

  • 0

How can I slide text out and in to replace one word in a sentence?

Here’s the sentence:

<p>Lorem <span>ipsum</span> dolor sit.</p>

I need to slide the word inside the <span> up and slide a new word in from the bottom.

The goal is to have an array of words that rotate in every n seconds. For example, given the following array:

var myArr = new Array('ipsum','alpha','beta','gamma','delta','epsilon');

How can I replace (via .slideUp(), I expect) the existing word with the next in the array?

I’m expecting the end result to somewhat resemble how an odometer might acts, but with text. Make sense?

Can you point me in the right direction?

  • 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-15T04:00:58+00:00Added an answer on June 15, 2026 at 4:00 am

    I think you might try

    var myArr = new Array('ipsum','alpha','beta','gamma','delta','epsilon');
    
    myArr.push(myArr.shift());
    
    • myArr.shift() gives you “ipsum”
    • myArr.push() puts it in the end.

    Edit :

    Ok Ryan, here is a solution, you could use a better animation, but this is for the sake of the example.
    And I was wrong first with the pop(), since that’s shift() you need here ! (edited as well)

    use this in the html :

            <span id="mySpan">plop</span>
    

    use this for javascript with jquery :

    var myArr = new Array('ipsum ','alpha ','beta ','gamma ','delta ','epsilon ');
        loop();
    
        function loop() 
        {
            $("#mySpan").slideUp(3000, function(){
                myArr.push(myArr.shift());
    
                $("#mySpan").empty();
                $("#mySpan").append(myArr[0]);
                $("#mySpan").show(200);
    
                loop();
            });
        }   
    

    JSFiddle: http://jsfiddle.net/eL3eG/

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

Sidebar

Related Questions

I need to create a slide show of some images that can go full
I have a JQuery slideshow where some text/slide fades in and out. At the
I have a tooltip attached to a panel that can slide down on the
How can i have slide downeffect? The effect will be similar with search function
How can I show more 3 slides ( =6) for slide show plugin for
How can I make this sliding panel example to slide down on mouseover and
I am using openXML and C# to generate a powerpoint slide but I can't
I have implemented a slide out div on my site that sits on the
How fast can I replace characters in a string? So the background on this
I'm trying to create an animation which will slide a textview out to 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.