0

There are resizing answers at Jquery resizing image

In the code, there is:

var maxWidth = 100; // Max width for the image
var maxHeight = 100; // Max height for the image

Is it possible to resize to fixed size of 100px x 100px?

Community
  • 1
  • 1
Paramasivan
  • 781
  • 3
  • 12
  • 27
  • This can be done with CSS `width:100px;height:100px;` however, the image will be stretched and look funny this way. you might be interseted in the jcrop library – docodemore Jun 26 '14 at 17:04
  • I am using the user uploaded images inside a step carousel. jcrop library doesn't work there. – Paramasivan Jun 26 '14 at 17:07
  • CSS has the **clip** property that can be set on absolutely positioned elements. [JSBin](http://jsbin.com/kajid/3/edit). – ryentzer Jun 26 '14 at 17:28

1 Answers1

1

Or you can use CSS as background-image while background-size: cover; background-position: center center;

Aylen
  • 3,524
  • 26
  • 36
Danny
  • 793
  • 1
  • 9
  • 20