Thumbnail previews just got much easier! Used to be, if you wanted to include a dynamic preview with Jcrop, you had to write client code. A number of people had difficulty adapting that code to their needs. No more! Now just attach a Thumbnailer object. Pass in the Jcrop instance, desired width, and height, and you're done.
$('#target').Jcrop({
aspectRatio: 1,
setSelect: [ 175, 100, 400, 300 ]
},function(){
var jcrop_api = this;
new $.Jcrop.component.Thumbnailer(jcrop_api,{ width: 130, height: 130 });
});
The constructor takes a reference to the Jcrop instance, and allows passage of various options such as initial width and height.
.jcrop-thumb {
top: -25px;
right: 20px;
border: 1px black solid;
}
The absolutely-positioned, sized thumbnail is appended to the Jcrop instance container automatically. It can then be positioned relatively to the container by using top/left/bottom/right CSS values. Styling such as a border or a box shadow can be added if desired.
resize(w,h)
method.