|
Posted by Chris Ianson on 03/22/06 01:00
"Chris Ianson" <notme@hotmail.com> wrote in message
news:X7HSf.37639$wl.28411@text.news.blueyonder.co.uk...
>> setTimeout("randquote();", 15000);
>> }
>> randquote();
>> </script>
>>
>> Ideally, you probably don't want an <INPUT> element, but want to use <Q>
>> or such. Done easily enough though.
>>
>> --
>> Toby A Inkster BSc (Hons) ARCS
>> Contact Me ~ http://tobyinkster.co.uk/contact
>
> That's great Toby. Here's the actual code I found that worked for the
> page refresh, but didn't include your timeout.
>
> Can you help me integrate a timeout function into my existing code below,
> so the quote changes say every 45 seconds, and is also randomised on page
> refresh please?
>
> <script language="JavaScript">
> var howMany = 2
> var quote = new Array(howMany+1)
> quote[0]="quote1"
> quote[1]="quote2"
> quote[2]="quote3"
> function rndnumber(){
> var randscript = -1
> while (randscript < 0 || randscript > howMany || isNaN(randscript)){
> randscript = parseInt(Math.random()*(howMany+1))
> }
> return randscript
> }
> quo = rndnumber()
> quox = quote[quo]
> document.write(quox)
> // End --></script>
>
> Thanks in advance :)
Any ideas Tony or anyone?
Navigation:
[Reply to this message]
|