Right now this only works on webkits built from 2012 onwards. It's not part of the spec (yet?).
This only works on Chrome 18+ and on Webkit Nightlies built in 2012 onwards. It seems to be a side effect of the CSS4 crossfading work, though this is a lot more useful.
<div id="cf6_image" class="shadow"></div>
Then the CSS:
#cf6_image {
margin:0 auto;
width:450px;
height:281px;
transition: background-image 1s ease-in-out;
background-image:url("/images/Stones.jpg");
}
#cf6_image:hover {
background-image:url("/images/Summit.jpg");
}
Pretty cool - this can easily be extended by simply changing the background-image property with JS, and makes things much much simpler. I'm not sure if this behaviour is part of the spec or not, and I haven't seen support anywhere other than in the afore mentioned browsers.
For a slightly more detailed example, have a look at a simple gallery using filters and fades.
Please add any questions/corrections/extra info below. Please be courteous to other users.
blog comments powered by Disqus