- Create Account

Text Colour Cycler

Forums > "Miscellaneous" Scripts > Text Colour Cycler
Author
Message

1) EMR Group: Members
Posts: 4 Joined: 3 Aug 2007 Location: Detroit IP: 68.40.--.--
Is there a way to use more than one style at a time? In other words lets say want one line to cycle colorA and the next line colorB.

thanks

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.173.--.--
Create several instances of the script maybe? To be honest that script is pretty old and I haven't looked at it in ages.

- Angus.

3) EMR Group: Members
Posts: 4 Joined: 3 Aug 2007 Location: Detroit IP: 68.40.--.--
any idea what to change? with 1 script i tried the following:

var waveText = new TextCycler('waveText');
with (waveText)
{
// Set an array of colours through which it cycles.
 colours = new Array(
 '#aa0000', '#cc2222', '#dd3333',  '#ee4444', '#ee4444', '#ff5555', '#ee4444',  '#ee4444', '#dd3333', '#cc2222',
 '#aa0000',  '#771e0f', '#56321a', '#334824',
 '#006633',  '#228855', '#339966', '#44aa77', '#44aa77',  '#55bb88', '#44aa77', '#44aa77', '#339966',  '#228855',
 '#006633', '#334824','#56321a', '#771e0f');

 // Some text...
 text = 'December';

// Optionally set speed and direction.
 //interval = 200;
 //step  = 1;
}

var  waveTextB = new TextCycler('waveTextB');
with (waveTextB)
{
// Set an array of colours through which it cycles.
 colours = new Array(
 '#f7923a', '#ea8a36', '#da8033',  '#c4742e', '#ac6629', '#945823', '#7a481d',  '#623a17','#4a2c11', '#311d0b',
 '#1c1106', '#000000',  '#1c1106', '#311d0b', '#4a2c11', '#623a17',  '#7a481d', '#945823', '#ac6629', '#c4742e',
'#da8033', '#ea8a36');

 // Some  text...
 text = 'October';

// Optionally set speed and direction.
 //interval = 200;
 //step  = 1;
}

// Call  it onload. Remember to add any other functions you're calling onload in here, and
// don't have a BODY ONLOAD section below.
window.onload = new Function('waveText.cycle()');
window.onload = new Function('waveTextB.cycle()');


then  i use
<div id="waveTextLayer"></div> and id="waveTextBLayer"


only  waveTextB shows up
i figure i missed a function or something else that should be duplicated and changed to B... guess I'll keep tinkering with it.

4) EMR Group: Members
Posts: 4 Joined: 3 Aug 2007 Location: Detroit IP: 68.40.--.--
realized that only the second window.onload shows up (i can reverse them)
maybe i need to load them differently

5) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.173.--.--
window.onload = function()
{
 waveText.cycle();
waveTextB.cycle();
};

Or  use a more robust solution like my addEvent script, but that will get you there.

Good luck - Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.