08 Feb

swapping image focus using javascript

I’ve seen a few pages where the background images fade gradually into other photos.

While walking to work, I wondered what it would look like to do the same, but fading into itself, with a different focal point. The results can be found in this example.

This example works in standards-compliant browsers only, because I don’t care about IE. If you want to get it to work in IE, then hack the code to use the filter:alpha() CSS manglement instead of the W3-recommended opacity.