CSSKarma

display your <style>

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.

with ease,
tim

Picasa feed

  • 2008-matadorLocation: Malibu, CADate: Aug 23, 2008Number of Photos in Album: 53View Album
  • 2008-uscDodgersLocation: Los Angeles, CADate: Aug 14, 2008Number of Photos in Album: 46View Album
  • 2008-movingLocation: Santa Monica, CADate: Jul 30, 2008Number of Photos in Album: 43View Album
  • 2008-GoingAwayLast weekend in RaleighLocation: Raleigh, NCDate: Jul 18, 2008Number of Photos in Album: 54View Album