How can I hide swiper js navigation buttons(left and right) when no more images are present in the particular direction
Eg. When there are no images in the right direction then the right navigation button should get hidden.
Using jQuery, you could do something like:
if (swiper.activeIndex===0) { $('.left-slide').hide() $('.right-slide').show() } else if (swiper.activeIndex === swiper.slides.length-1) { $('.left-slide').show() $('.right-slide').hide() }
First condition is the first slide
548k questions
547k answers
4 comments
86.3k users