next and previous arrow in gallery product page in prestashop 1.7.
$(document).on('click', '.product-cover .prev', function(e){
e.preventDefault();
var next_img = $('.js-qv-mask .product-images li img.selected').parent().parent().prev().find('img.thumb');
$('.js-qv-mask .product-images li a').find('img').removeClass('selected');
next_img.addClass('selected');
$(".product-cover img").attr('src',next_img.attr('src'));
});
$(document).on('click', '.product-cover .next', function(e){
e.preventDefault();
var next_img = $('.js-qv-mask .product-images li img.selected').parent().parent().next().find('img.thumb');
$('.js-qv-mask .product-images li a').find('img').removeClass('selected');
next_img.addClass('selected');
$(".product-cover img").attr('src',next_img.attr('src'));
});
e.preventDefault();
var next_img = $('.js-qv-mask .product-images li img.selected').parent().parent().prev().find('img.thumb');
$('.js-qv-mask .product-images li a').find('img').removeClass('selected');
next_img.addClass('selected');
$(".product-cover img").attr('src',next_img.attr('src'));
});
$(document).on('click', '.product-cover .next', function(e){
e.preventDefault();
var next_img = $('.js-qv-mask .product-images li img.selected').parent().parent().next().find('img.thumb');
$('.js-qv-mask .product-images li a').find('img').removeClass('selected');
next_img.addClass('selected');
$(".product-cover img").attr('src',next_img.attr('src'));
});
Comments
Post a Comment