...

View Full Version : Marquee



Raraken
05-01-2004, 06:45 AM
Alright, Basically, I'm trying to make a marquee (right now its just regular HTML, But I'm willing to change it)

I want it so, when its done a loop, it will execute a function.

swmr
05-01-2004, 11:22 AM
You might be better served by displaying your current code, and describing the functional concept to be applied...

Raraken
05-01-2004, 03:41 PM
Heres its Java component. I want it to change articles randomly visa vie the array.



var ticker = new Array ();
for (var r=0; r < 100; r ++) {
ticker[r] = "hello, my Value is: " + r + "!!!";
}
function SDH_chooseItemTick() {
var randA = Math.random()*ticker.length;
var chosen = Math.random()*randA;
tickerMarquee.innerHTML = ticker[Math.round(chosen)]
}


And heres the marquee component:



<marquee width="100%" scrolldelay="40" scrollamount="2" style="
font-size: 7pt;
verticle-align:
middle;"
id="tickerMarquee">

GalacNetworks News Ticker

</marquee>

trib4lmaniac
05-01-2004, 04:23 PM
<marquee onStart="SDH_chooseItemTick()">

Works in IE4 and up. You dont get the original message though because it changes straight away, but that's easily fixed by by just putting an if statement in the function

ctrl=1;

function SDH_chooseItemTick() {
if(ctrl==1){
tickerMarquee.innerHTML = 'GalacNetworks News Ticker';
ctrl++;
}else{
var randA = Math.random()*ticker.length;
var chosen = Math.random()*randA;
tickerMarquee.innerHTML = ticker[Math.round(chosen)];
ctrl++;
}
}

glenngv
05-03-2004, 05:42 AM
You may want to see bunch of cross-browser scroller scripts (http://www.dynamicdrive.com/dynamicindex2/index.html) at dynamicdrive



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum