How to center images in carousel items?
Append next two callback function to SmartWave init code and all images with ”.sw-align-center” class that are inside of ”.sw-content” DIV will be centered
onPreloadImages: function(){
$(this).data('smartwave-api').refresh();
},
onResize: function(){
$(this).find('.sw-images-loaded .sw-content').each(function(){
var c = $(this), m = $('.sw-align-center', this).css('display','block');
if(m.width() > c.width()) {
m.css('margin-left', (c.width()-m.width())/2);
}
if(m.height() > c.height()) {
m.css('margin-top', (c.height()-m.height())/2);
}
});
}