Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 871 Bytes

README.md

File metadata and controls

46 lines (39 loc) · 871 Bytes

jQuery.imgfit

https://github.com/pilssalgi/jQuery.imgfit

HowToUse

##code

img-wrap {
  position: absolute;
  width: 80%;
  height: 80%;
  left: 10%; top:10%;
  background-color: #444;
  overflow: hidden;
}
<div id="img-wrap">
  <img src="img/img2.jpg" class="fitimg">
</div>
$('.fitimg').imgfit();
$('.fitimg').imgfit({
  align       : "c", 
  fit         : "contain", 
  canvasMode  : true, 
  position    : "absolute", 
  callBack    : function(){} 
});

###parameters

align      : "c" , "l", "t", "r", "b", "lt", "lr", "rt", "rb"
fit        : "cover" , "contain", "width", "height"
canvsMode  : true , false
position   : "absolute","relative"
callBack   : function(){}