This is the jQuery Backgrounder plugin. This plugin allows you to fill the background of a page with an image–all while maintaining the aspect ratio and gracefully handling window resizing.
- Include jQuery and the plugin file in your page
- Add a div to your page which includes an image. The div can be set to display:none; if you'd like. I prefer fairly large images but any size will do.
- Call the backgrounder() function on your div—preferably when the page loads.
- Include the "element" option to apply it to a specific element (default is the body)
- No CSS file is required
- Use the demo.html page for guidance.
This little plugin is licensed under the MIT license. See the MIT-LICENSE.txt file for details. The image used in this example (birthday.jpg) is copyrighted (by me) and may not be used by you. Why would you want a picture of my kid, anyway?