20061027 Friday October 27, 2006

Random CSS Background Image

I'm flirting with some dangerous downtime right now so I figure I'll write out a blog, maybe with something useful. Here goes nothing...

Link: http://www.javascriptkit.com/script/cut176.shtml

so that's the link I came across while searching for a random background image generator. It takes a little tweaking, but works really well with your style sheet and is pretty light-weight. If you're concerned at all about users browsing with JavaScript turned off you can also define a background image in the CSS file so that will load first and then the random JS image will load (you can see it happen if you rapidly refresh the page a few times, otherwise it's fairly smooth).

I've used this a few times with very little trouble, seems to work fine cross-browser, but again, if it doesn't for some reason, you'll always have the original bg image in the CSS to mask it.

Get FireFox

Cheers,
_Tim

Posted by tcwrigh2 ( Oct 27 2006, 09:58:29 AM EDT ) Permalink Comments [0]
Trackback URL: http://blogs.lib.ncsu.edu/cadence/entry/random_css_background_image
Comments:

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: Allowed