Skip to content

pilssalgi/jQuery.imgfit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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(){}

About

set fit image size to container size

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published