imgLiquid

jQuery plugin to resize images to fit in a container.

  • Owner: karacas/imgLiquid
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    2
      Compare:

Github stars Tracking Chart

ScreenShot

imgLiquid v0.9.944 / 11-04-2013

A jQuery Plugin to resize images to fit in a container.

Alejandro Emparan (karacas) / @krc_ale
Dual licensed under the MIT and GPL licenses.
## 

Usage

Include:

<script src="js/imgLiquid-min.js"></script>

js:

$(document).ready(function() {
	$(".imgLiquidFill").imgLiquid();
});

Html:

<div class="imgLiquidFill imgLiquid" style="width:300px; height:200px;">
	<img alt="Woody" src="woody.jpg" />
</div>

View in action:

http://jsfiddle.net/karacas/3CRx7/#base

http://codepen.io/karacas/pen/nlugd

Features:

    - Uses CSS Background-size when is available. (new!)
    - Bootstrap compatible.
    - Lightweight: < 2.0KBs gzipped.
	- Fill / Crop.
    - Align.
	- Responsive.
	- Svg support.
	- CallBacks.
    - HTML5 data-* attributes.
	- All browsers (Incl. ie6).

 

Options:


    >js
        fill: true,
        verticalAlign:      // 'center' //  'top'   //  'bottom' // '50%'  // '10%'
        horizontalAlign:    // 'center' //  'left'  //  'right'  // '50%'  // '10%'

        //CallBacks
        onStart:        function(){},
        onFinish:       function(){},
        onItemStart:    function(index, container, img){},
        onItemFinish:   function(index, container, img){}

    >hml5 data attr (overwrite js options)
        data-imgLiquid-fill="true"
        data-imgLiquid-horizontalAlign="center"
        data-imgLiquid-verticalAlign="50%"

Main metrics

Overview
Name With Ownerkaracas/imgLiquid
Primary LanguageHTML
Program languageJavaScript (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2012-10-05 17:57:31
Pushed At2018-07-06 14:19:33
Last Commit At2018-07-06 11:19:32
Release Count29
Last Release Name0.9.944 (Posted on )
First Release Name0.1.0 (Posted on )
用户参与
Stargazers Count1k
Watchers Count66
Fork Count206
Commits Count159
Has Issues Enabled
Issues Count38
Issue Open Count14
Pull Requests Count7
Pull Requests Open Count1
Pull Requests Close Count2
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private