psuedo code: var totalDivLength = $("div").length; var randomnumber = Math.floor(Math.random()*totalDivLength) $("div")[randomnumber].show()
Scott, I can think of a couple reasons for this. Let's say you want to scroll some facts or quotes or customer testamonials across the screen, but you also want to start at a random one. That sort of thing. Or scrolling images. Hope this helps, On 6/26/07, zarino <[EMAIL PROTECTED]> wrote:
Hi! Is it possible to use jQuery to choose an extract of HTML (for example one div out of a possible ten to choose from) and insert it in a page? I'd like to create a repository of 'facts' and have jQuery serve up a different fact at random with each page-load. I've searched and searched the web, but nothing seems to jump out. Is it too difficult? And if so, does anybody know any other way? Many thanks. Zarino Zappia