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

  • Home
  • SEARCH
  • 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 8827165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:18:41+00:00 2026-06-14T07:18:41+00:00

How do I write a Javascript that flashes an array of texts (in this

  • 0

How do I write a Javascript that flashes an array of texts (in this case words)? I’m very new to Javascript. I have like 5 string arrays and I want these to flash and fade in order. If the last one reaches it will start from the beginning. I’m not really looking for sharp disappear and appear, but kind of fading and reappearing slowly kind of mechanism like a news bulletin.

- "Car"
- "Dog"
- "Sky"
- "Building"

car - <fade> - <appear> - dog - <fade> - <appear> - sky  ... etc.

If someone provides a link or actual code, I’m willing to accept the answer quickly and give you points.

It is done like this:

    var array = ["Hello", "World"]
    var len = array.length
    for (var i = 0; i < array.length; i++) {
        var interval = loopVerySlowly(array, i);
    }

    function loopVerySlowly(array, index) {
        function doSomething() {
            var _content = document.getElementById("hello");

            _content.innerHTML = array[index];

            index = (index + 1) % array.length; // increment for next time
        }

        return setInterval(doSomething, 1000 * 5);
    }
  • 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-14T07:18:42+00:00Added an answer on June 14, 2026 at 7:18 am

    When I started off learning javascript everyone was like learn jQuery, it makes everything much easier and I will pass the same help off to you ‘learn jQuery’. More here

    fadein is a lot easier in jquery so here is some docs

    here
    fadeout is also here
    .

    So a bit of background.
    jQuery is a javascript Library which it’s slogan is ‘write less do more’ Which is exactly what it does, the example below would be a lot larger if it wasn’t for jQuery. JQuery needs to be placed in your website script as most of you’r javascript files do, in the example below I use
    google content Delivery Network (CDN) which is here https://developers.google.com/speed/libraries/devguide. You also can download it and keep it on you server, but if you have limited band width and space on your server it probably would be better if you let google to host it.

    so for a example

        <html>
          <head>
            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
        <script type="text/javascript">
         $(document).ready(function(){
           $(".fadein").click(function(){
                $(".fade").fadein('slow');
            });
            $(".fadeout").click(function(){
                $(".fade").fadeOut('slow');
            });
        });
    
    </script>
    
          </head>
          <body>
            <div class="fade" style="background: black; width: 300px; height: 300px;position: absolute"><p> I can fadein</p></div>
            <button class="fadein">fadein<button
            <button class="fadeout">fadeout</button>
    
    
    
          </body>
        </html>
    

    also here is a example for everything I just used

    here is a jsFiddler: located Here also a jsfiddler for fading and showing in order example here

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

Sidebar

Related Questions

can you write javascript that produces/writes/etc. functioning javascript? for example, have a link that
I tried to write some javascript that takes the entries of an array and
I have to write a javascript function that is returning the current size (in
How do I write a javascript function that takes one string argument which is
I want to write a javascript function that returns HTML content as string given
I'm trying to write a Javascript regex that matches words with less than 3
I would like to write JavaScript code that flattens the DOM of an arbitrary
If I write some JavaScript that runs in an <iframe> (which is dynamically created
Can anyone tell me how to write javascript code that removes everything after the
Is there any other way to write javascript:false that is more pleasant? I'm building

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.