Having an issue with Swiper slider and pagination that I want to hide if there is content in the caption division.
I've created a JSFiddle (http://jsfiddle.net/1sta65uv/2/) and done some research, but haven't found a solution yet. I know I need to use an if statement, but how do I link it to the length?
Could someone help me out? It would be much appreciated!
<!-- Swiper -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<img src="http://placekitten.com/500/300">
<div class="caption">Image caption</div>
</div>
<div class="swiper-slide">
<img src="http://placekitten.com/500/300">
<div class="caption"></div>
</div>
<div class="swiper-slide">
<img src="http://placekitten.com/500/300">
<div class="caption">Image caption</div>
</div>
<div class="swiper-slide">
<img src="http://placekitten.com/500/300">
<div class="caption"></div>
</div>
</div>
<!-- Add Pagination -->
<div class="swiper-pagination"></div>
<!-- Add Arrows -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
edit:
I want to hide the pagination when there is content in the caption for a dynamic page.
Which means:
Slide 1 has pagination
Slide 2 pagination hidden
Slide 3 has pagination
Slide 4 pagination hidden