i have added a script to use custom buttons for my slider as follow :
<code><script>
jQuery(document).ready(function($) {
function getSwiperInstance() {
var swiperTarget = $('#my-value-carousel .swiper');
return swiperTarget.data('swiper');
}
$('#my-prev-value').on('click', function() {
getSwiperInstance().slidePrev(500, true);
});
$('.my-next-value').on('click', function() {
getSwiperInstance().slideNext(500, true);
});
});
</script>
</code>
<code><script>
jQuery(document).ready(function($) {
function getSwiperInstance() {
var swiperTarget = $('#my-value-carousel .swiper');
return swiperTarget.data('swiper');
}
$('#my-prev-value').on('click', function() {
getSwiperInstance().slidePrev(500, true);
});
$('.my-next-value').on('click', function() {
getSwiperInstance().slideNext(500, true);
});
});
</script>
</code>
<script>
jQuery(document).ready(function($) {
function getSwiperInstance() {
var swiperTarget = $('#my-value-carousel .swiper');
return swiperTarget.data('swiper');
}
$('#my-prev-value').on('click', function() {
getSwiperInstance().slidePrev(500, true);
});
$('.my-next-value').on('click', function() {
getSwiperInstance().slideNext(500, true);
});
});
</script>
but the buttons are only working when im logged in.
any ideas what the problem may be ?
what should could cause this issue ?
New contributor
mohammad alakel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.