项目
在 GitHub 查看
karacas/imgLiquid
关于
jQuery 插件,可调整图像尺寸以适应容器。
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
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%"
探索相关项目
加载中…