Incorrect height of slide with enabled autoHeight option

This article will help you if with enabled autoHeight option height of slide is calculated incorrectly.

If you have images in slide that don't have rsImg class and don't have fixed size, slider won't be able calculate height of slide properly, as you can not get size of an image that isn't loaded.

To fix this apply fixed height to images in pixels. Or instead of initializing slider in document ready use window.load that will fire only when all images are loaded.

// wait until every image on page is loaded
$(window).load(function() {
     // initialize slider
         // options


$(window).load(function() {
     // update size of slider (if you already initialized it before)
     $('.royalSlider').royalSlider('updateSliderSize', true);

Also, autoHeight doesn't work with properties like autoScaleSlider, imageScaleMode and imageAlignCenter, as it's impossible to center something in "unknown" height. So make sure that they're disabled.

autoHeight: true,
imageAlignCenter: false

Please note that autoHeight option adds additional transition to slide, so think twice before enabling it, do you really have slides of different height?