views:

25

answers:

2

Google recently added backgrounds to it's home page .. Like it or hate it, it's got the ability to resize the background image while keeping the same proportions as the browser window resizes...

Anyone know of any jQuery to do that?

+2  A: 

Width is set to a percentage.

Babiker
A: 
$(window).resize(function() {
   $('#imgContainer').width( $(this).width() );
                     .height( $(this).height() );
});
Dan Heberden