Skip to content
Resizable full-browser background image using jQuery. Implementation requires no CSS.
Pull request Compare This branch is even with iamjpg:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
css
image
js
README.textile
index.html
random_image_example.html

README.textile

Overview

The jQuery Easy Background Resize plugin is intended to easily allow a background image to dynamically resize itself to the size of the browser keeping the images aspect ratio in tact.

Installation Instructions

First, make sure you have jQuery loaded within the <head> tag of your page.

<script src="http://www.google.com/jsapi"></script>
<script>google.load("jquery", "1");</script>

Second, put the jQuery EZ Background Resize script in your <head> tag.

<script src="javascripts/jquery.ez-bg-resize.js"></script>

Third, simply call the plugin with an absolute path or relative path to your image:
Note that width and height are required. Won’t work in IE without it.

$("body").ezBgResize({
img : "image/bg.jpg"
});

Optional Settings

Optional arguments are center & opacity.

$("body").ezBgResize({
img : "image/bg.jpg",
opacity : .75,
center : false
});

Something went wrong with that request. Please try again.