Currently, I am utilizing the owl-carousel-2 plugin for my project.
However, I have come across a particular issue:
The coding structure:
<div class="owl-carousel" style="display: none;">
<div class="item"><img src="..." /></div>
<div class="item"><img src="..." /></div>
<!-- ... -->
<div class="item"><img src="..." /></div>
</div>
<script>
$(function() {
var $owl = $('.owl-carousel');
$owl.owlCarousel();
// Various operations performed here.
$owl.show();
});
</script>
The issue at hand:
Upon initializing with the $owl.owlCarousel();
command while being hidden, the sizing does not get properly initialized.
Hence, upon displaying the control, everything appears scrambled!
Surprisingly, when the window is resized, some sort of re-rendering occurs. This results in a proper display of content.
I am pondering if there exists a method to manually trigger this re-render (or refresh) process.
This action will ensure that the control displays correctly without any mess.
Despite attempting to study the documentation and sources available, I have yet to discover a satisfactory solution.
Your assistance on this matter would be greatly appreciated.