Hi,
When I'm using chrome and refresh the page, the image is only 1px height.
You can check the bug here. Only when refresh the page and chrome:
http://cultura.burjassot.org/teatro/la-asombrosa-historia-de-mr-snow/
it's working now, close the issue
The bug is still.
Now it is working but with a css trick:
$(document).ready(function() {
$('#galeria').css({'opacity':'0'});
});
$(window).load(function() {
$('#galeria').owlCarousel({
autoHeight: true,
items : 1,
});
$('#galeria').css({'opacity':'1'});
});
Can someone verify that this is still an issue?
Please upgrade to the newest version of Owl Carousel, released today, and re-open this issue if it persists.
I can still replicate this issue when calling from document.ready, if the call is made with window.load everything works.
You need to use $(window).load instead of $(document).ready if you want to use autoHeight with images. ready fires before images are loaded, so autoHeight is working as it should by setting the height to be 0 or 1 pixels tall. Another option would be to set up the carousel on ready, but trigger a refresh.owl.carousel on load so that the carousel knows to re-check the element's height.
This thread seems a little divided. Can anyone confirm that using $(window).load is the proper/best way to initiate the the owl slider with images and autoHeight? The autoHeight demo uses <div>s with set heights in CSS and not responsive heights from images like many developers are intending to do. It makes sense that the demo is able to use $(document).ready without issue. Using $(window).load with images works for me but there is a FOUC.
$(window).load works for me too
confirm - $(window).load - works for me as well
Thanks!
I just had this error and can also confirm window.onload works.
Thanks for the tip.
Most helpful comment
You need to use
$(window).loadinstead of$(document).readyif you want to use autoHeight with images.readyfires before images are loaded, so autoHeight is working as it should by setting the height to be 0 or 1 pixels tall. Another option would be to set up the carousel onready, but trigger arefresh.owl.carouselonloadso that the carousel knows to re-check the element's height.