Simple Fullscreen Background Image Plugin with jQuery

File Size: 4.19 KB
Views Total: 1394
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Simple Fullscreen Background Image Plugin with jQuery

A simple cross-browser jQuery plugin that automatically stretches an images to fill/fit the full window while preserving aspect ratio and maintaining centering.

How to use it:

1. Wrap your background image into a container.

<div class="background">
  <img alt="" src="background.jpg">
</div>

2. Include the simple full background jQuery plugin after loading jQuery library.

<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="jquery.simple-full-background.js"></script>

3. Call the plugin on the background container.

$(document).ready(function () {
  $(".background").fullBackground();
});

This awesome jQuery plugin is developed by mayke5421. For more Advanced Usages, please check the demo page or visit the official website.