Scrollable

Tweet

Download - gniusBackground v0.5.5

This script scales the background-image to full-screen with aspec ratio depended on your browsers window size. It also has options to be scrollable or fixed.


Donate a contribution to support the development.


Supported Browsers:

How to use:

Just add each snippet in each section.

Javascript:

new gniusBackground('myElement',{
            scrollable  : false,
            width       : 1024,
            height      : 677
});

HTML:

<div id="myElement">
            <img src="http://farm6.staticflickr.com/5060/5519822237_f016b612bc_b.jpg">
</div>

CSS:

#myElement{
            top         : 50%;
            left        : 50%;
            z-index     : 1;
}
Fork me on GitHub
Take a Tour