...

View Full Version : :: looking for a random news script ::



babelfish
06-12-2003, 05:17 PM
hi peeps :D

basially i want a script that will display random pieces of news in a kind of marquee styleee on various pages on one of my sites.

i think i could make one that just displays 1 random piece of news but i would like it to ideally scroll and im totally out of practice as ive hardly done any dev work in the last 8 months or so :(

cheers peeps! ;)

requestcode
06-12-2003, 06:22 PM
Maybe some of these will work for you:
http://www.javascriptkit.com/script/cutindex3.shtml
http://www.dynamicdrive.com/dynamicindex2/index.html

babelfish
06-13-2003, 09:41 AM
hmmm - the things with these scripts on all the pages is that they loop the news in the same order....

this is pointless as users only ever see the same few messages :( messages later on in the list never get seen by anybody

anyone else got any ideas?

Skyzyx
06-13-2003, 05:26 PM
You could use one of the scripts above, and just add an array randomizer.



// RANDOMIZE ARRAY VALUES
function xRandom(zArrayName)
{
temp='';
for (i=0; i<1; i++) temp+=zArrayName[(Math.floor(Math.random()*(zArrayName.length)))];
return temp;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum