I need a re-primer
Date: 10/27/05
(Javascript Community) Keywords: css, web
I know this is insanely stupidly simple, and will probably only take about 5 lines of code, but I haven't written in JS soooo long. Essentially, I'm going to use CSS to implement a massive random formatting to a web site - dynamically generating the formatting on every load. Here's what I want in psuedo code:
OnLoad, generate random number randWord five times and store values. For each randWord selected greater than 3 letters long, generate two random numbers randColor and randFormat, relate it to the proper formatting, and apply these to the word. Continue through the entire document until the end is reached.
The range for each randWord value is between 2 and 5, and the possible formatting follows:
Colors - red, dark blue, black, white, dark yellow, and pink
Formats - highlighted, underlined, bold, bigger, and italicised
If it's highlighted, the highlight is in the color of randColor, and the word is either black or white, predefined (depending on what shows up best).
Anyone know of any snippets like this, willing to write it, or hold my hand through it? I won't need to have explained a lot of JS stuff, I'll know it when I see it, but it's just a matter of knowing it - get what I mean? I can't think of the functions off the top of my head, but I do know what they are =)
Thanks so much in advance =P
Source: http://www.livejournal.com/community/javascript/81364.html