Forum Moderators: not2easy

Message Too Old, No Replies

loading random div - is it possible?

         

SBee

3:23 pm on Mar 25, 2008 (gmt 0)

10+ Year Member



Hi-

I have use css and javascript to be able to load a random image (from an array) on page load in the past. Is this possible to do with a div of content?
I have 3 areas on a page that the client wants to randomize - i know i could do it if the content was flash, or images, not sure if i can with html text...

Thanks in advance.
Shawna

Xapti

6:56 pm on Mar 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This seems to be in the wrong forum section.

That can be done with PHP (as well as images, as I'm sure you'd realize), but I am not sure if javascript could do it. Javascript should be able to dynamically add content such as text in a div, and all that's left if reading the files it can choose from, which I believe javascript can also do.

swa66

11:24 pm on Mar 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd agree with Xapti: you can introduce randomness when you generate the HTML code, or you can influence the code through javascript (DOM), but in pure CSS there is now (easy) way to create randomness (not counting MSFT's expressions as they're not standard).