Jquery 引导旋转木马跳跃如何找到高度但不固定

Jquery 引导旋转木马跳跃如何找到高度但不固定,jquery,css,twitter-bootstrap,Jquery,Css,Twitter Bootstrap,我正在使用引导转盘,但在下一次幻灯片放映时我注意到一个跳跃 因为我想让它反应灵敏,所以我不能设定一个固定的高度 var $carousel_height = $('#myCarousel .item img').outerHeight(); var $carousel_height2 = $('#myCarousel .item img').css("height"); console.log($carousel_height ); console.log($carousel_heig

我正在使用引导转盘,但在下一次幻灯片放映时我注意到一个跳跃

因为我想让它反应灵敏,所以我不能设定一个固定的高度

var $carousel_height = $('#myCarousel .item img').outerHeight();
var $carousel_height2 = $('#myCarousel .item img').css("height");
console.log($carousel_height );     
console.log($carousel_height2 );

$('#myCarousel').css('height', $carousel_height2);//apply
我使用了上面的代码,但都给了我0px,我相信是因为我将图像标签的宽度设置为100%

那么,有没有办法将高度设置为等于第一张幻灯片的高度? 或者其他不跳的方法

谢谢