At the moment you are just ouputting the quote from javascript using document.write - but you can't change existing text using document.write, as it only adds contents to the page. You should really learn a DOM manipulation library like jQuery, it really makes doing this kind of thing a lot easier.
With jQuery your function might look like the following (including cssfreaks changes):
HTML:
<h1>What the world thinks?</h1> <div id=\"quote\"></div>
Javascript:
function rotateQuotes() { var whichquote = Math.floor(Math.random()*(quotes.length)); $('#quote').html(quotes[whichquote]); setTimeout(\"rotateQuotes()\",100000); }
By the way you can only have one <h1> per page, so you should really change those to h2 or h3.
this code running perfectly when i click on my page or refresh it... is that possible to autorate the quotes after sometime
u can see the live example playbackgroup.com right panel in top box where quotes are coming
I think he means rotate. ie. Refresh the quote after a specified amount of time.
try this let me know if this helps u
With jQuery your function might look like the following (including cssfreaks changes):
HTML:
Javascript:
function rotateQuotes() {var whichquote = Math.floor(Math.random()*(quotes.length));
$('#quote').html(quotes[whichquote]);
setTimeout(\"rotateQuotes()\",100000);
}
By the way you can only have one <h1> per page, so you should really change those to h2 or h3.
i told u in my last post tht u r really a GENIUS.. :D