It can be specified in css.
Example,
http://jsfiddle.net/AwBLL/2/
.owl-carousel .owl-item{
height:285px;
width:100%;
}
EDIT
The following solution uses the plugin's callback events to modify the viewport's/wrapper's height according to the smallest image height.
http://jsfiddle.net/DNMpF/1/
js
$(document).ready(function () {
$("#owl-example").owlCarousel({
afterUpdate: function () {
updateSize();
},
afterInit:function(){
updateSize();
}
});
function updateSize(){
var minHeight=parseInt($('.owl-item').eq(0).css('height'));
$('.owl-item').each(function () {
var thisHeight = parseInt($(this).css('height'));
minHeight=(minHeight<=thisHeight?minHeight:thisHeight);
});
$('.owl-wrapper-outer').css('height',minHeight+'px');
}
});
css
.owl-carousel .owl-item img {
height:auto;
width:100%;
display: block;
}
.owl-carousel .item {
margin:0px;
}
EDIT2
Regarding the latest comment, to show the bottom part of the large images one approach could be to iterate the images and add a negative top margin equal to the part of these images hidden.
function updateSize(){
var minHeight=parseInt($('.owl-item').eq(0).css('height'));
$('.owl-item').each(function () {
var thisHeight = parseInt($(this).css('height'));
minHeight=(minHeight<=thisHeight?minHeight:thisHeight);
});
$('.owl-wrapper-outer').css('height',minHeight+'px');
/*show the bottom part of the cropped images*/
$('.owl-carousel .owl-item img').each(function(){
var thisHeight = parseInt($(this).css('height'));
if(thisHeight>minHeight){
$(this).css('margin-top',-1*(thisHeight-minHeight)+'px');
}
});
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…