|File Size:||3.07 KB|
|Official Website:||Go to website|
coverimage is a lightweight, cross-browser jQuery plugin for responsive web design that makes the regular images behavior like the CSS
background-size : cover attribute. The plugin will dynamically resize/crop your images and make them always be centered no matter you resize the browser window.
How to use it:
1. Add your image into a parent DIV container like this:
<div class="parent"> <img src="1.jpg" alt="Image"> </div>
2. Download the plugin and include the
jquery.coverimage.js script along with jQuery library at the bottom of the webpage.
<script src="//code.jquery.com/jquery.min.js"></script> <script src="jquery.coverimage.js"></script>
3. Attach the plugin to the image. That's it. The plugin will automatically resize and center the image inside the DIV container '.parent' on window resize.