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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:17:34+00:00 2026-05-23T17:17:34+00:00

Here’s a fun little script I’m trying to make. Flash words from an array

  • 0

Here’s a fun little script I’m trying to make. Flash words from an array with random colors from another array. (I’m mostly thinking about having a moving bg type deal.)

I’m having problems with creating some sort of loop to cause the words to “flash/change” so far all it does is change on page reload.

*new*
Well I changed it so now it is just one function… and it WORKS!! but it seems that it uses the browsers memory or something and crashes…. oops… is there a clear memory or something for javascript that I should use??

<html>

<head>
<style>

body

{
  color:black;
}

#quotes 
   {

   }
</style>

</head>

<body>

<script type="text/javascript">

function showQuote() 
{

pickWords =

[
  "Hi!",
  "Welcome!",
  "Hello!"
]

var word22 = pickWords[Math.floor(Math.random()*pickWords.length)];


pickColors =

[
  "#aa2233",
  "#00cc44",
  "#F342AA"
]

var Color22 = pickColors[Math.floor(Math.random()*pickColors.length)];


var Top22 = (Math.floor(Math.random()*800));
var Left22 = (Math.floor(Math.random()*800));

var style33 = '<h4 style="padding-bottom:0px; padding-top:'+Top22+'px; padding-left:'+Left22+'px; font-size: 2.3em; color:'+Color22+';">';
var style34 = '</h4>';

var finWord22 = style33 + word22 + style34;


var duration = 400;  




     document.getElementById("quotes").innerHTML=finWord22;
setInterval('showQuote()',duration);

}


onload = function()
{
showQuote();
}



</script>

<div id="quotes"></div>


</body>
  • 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-23T17:17:35+00:00Added an answer on May 23, 2026 at 5:17 pm

    You would need to ‘pickword’ inside the showQuote() function.

    Right now, you are picking a word onload, and use that word on every timeout.

    Wrap your whole code into a function and call that function on load.

    function ShowQuote(){
        //...
        setTimeout(ShowQuote, duration);
    }
    
    ShowQuote();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Here's my scenario - I have an SSIS job that depends on another prior
Here's what I'm trying do to in a single SQL Server procedure: @ID1 int
Here's an excerpt from java.text.CharacterIterator documentation: This interface defines a protocol for bidirectional iteration
Here, i have coded to get data from DB. I want to store the
Here is a shell script: echo Starting Jarvis Program D. ALICE_HOME=. SERVLET_LIB=lib/servlet.jar ALICE_LIB=lib/aliceserver.jar JS_LIB=lib/js.jar
Here I had a problem that I am adding contact from the address book
Here is what I am trying to achieve in PHP: I have this string:
Here's what I'm trying to do... It's quite simple and obviously there must be
Here is another spoj problem that asks how to find the number of distinct

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.