One of these unique things, something that’s been wanted and needed by many at one point or another, is a background image that can resize! Using HTML alone, this can be quite a tricky task with relative and absolute objects (images) that sit with custom dimensions and can be pushed behind other objects that have those same dimensions. There’s a bit to keep track of, so here’s a jQuery Autostretch plugin which does all the work for you.
Here’s a demonstration of a background image positioned center, which gives the feel of the resize, but isn’t a true solution. (move video to 40 seconds)
Here’s an actual code walk through of how to do this. (move video to 8:30 for demonstration) This video is very easy to follow.
Or, save yourself the effort and use the jQuery plugin. Enjoy!
One Response to Dynamically Resize Background Images with jQuery