Image Cover jQuery Plugin v1.0.1
Resize proportionally and center image to fill with it a container element.
This plugin was created about my personal needs in my developments. It's simple, light and solves a specific need. I think that it can be useful to others developers.
I will work in it to add new features keeping the simple and concrete spirit of the plugin.
Installation
Add it in your <head>
page.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script type="text/javascript" src="jquery.image-cover.min.js"></script>## How to use
Add the '.image-cover' class in all images that you want apply the plugin.
<img src="image.jpg" class="image-cover"/>
Plugin will detect the inmediatly parent to fill image in it.
<article> <img src="image.jpg" class="image-cover"/> </article>
Support to add content above image.
<a href="/"> <span> Link text </span> <img src="example.jpg" class="image-cover"/> </a>
You also can use your own class.
$(".my-class").imageCover();
The plugin have a Bootstrap Carousel support.
$(".my-class").imageCover({ carousel: "#your-carousel-id" // Bootstrap carousel support });
Updates
v1.0.1
- Support to auto absolute position to elements above image.
v1.0.0
- First stable release.