eyesofsociety Posted July 9, 2006 Share Posted July 9, 2006 Hello. I have here a script that will display 3 different sets of rotating quotations (that rotate every second). What I have been trying to have it do though, is to have distinct content on each three of the quotations (so that quotation one does not use any of the quotes used in quote2, or quote3. This is the script I have for 3 quotations rotating (but they are all rotating the same thing).html><head><script language="JavaScript">function rotateEvery(sec){ var Quotation=new Array() // QUOTATIONS Quotation[0] = 'two'; Quotation[1] = 'three'; Quotation[2] = 'four'; Quotation[3] = 'five'; Quotation[4] = 'six'; Quotation[5] = 'seven'; Quotation[6] = 'eight'; Quotation[7] = 'nine'; var indices = randoms(3, Quotation.length - 1); for (i = 0; i < indices.length; i++) { var id = 'textrotator' + i; document.getElementById(id).innerHTML = Quotation[indices[ i]]; } setTimeout('rotateEvery('+sec+')', sec*400);}function randoms(howMany, maxValue){ var values = new Array(); values[0] = randomInt(maxValue); for (i = 1; i < howMany; i++) { var j = randomInt(maxValue); while (j == values[i - 1]) { j = randomInt(maxValue); } values[ i] = j; } return values;}function randomInt(max){ return Math.round(Math.random() * max);}</script></head><body onload="rotateEvery(1)"><div id="textrotator0"></div><div id="textrotator1"></div><div id="textrotator2"></div></body> Quote Link to comment Share on other sites More sharing options...
brown2005 Posted July 9, 2006 Share Posted July 9, 2006 they are not the same mate....they rotate different things all the time Quote Link to comment Share on other sites More sharing options...
eyesofsociety Posted July 9, 2006 Author Share Posted July 9, 2006 that's correct that they all rotate different things at each time, but they all also overlap each other. i'd like for there to be only sections of the listed quotes going to one text, and the others being assigned to others so all the different texts rotate but none of them overlap each other in content.i found somebody trying to come up with the same thing --[url=http://www.thescripts.com/forum/thread147385.html]http://www.thescripts.com/forum/thread147385.html[/url]perhaps i need multiple arrays? this page uses multiple arrays[url=http://codepunk.hardwar.org.uk/samp127.htm]http://codepunk.hardwar.org.uk/samp127.htm[/url]but it only rotates upon refresh. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.