single product visiblity? version
This commit is contained in:
parent
2ae7ed10ad
commit
ce7b4a4b2b
1 changed files with 25 additions and 25 deletions
|
@ -1,28 +1,28 @@
|
|||
//jQuery(document).ready(function ($) {
|
||||
// $('.product-image-slider').each(function () {
|
||||
// let slider = $(this);
|
||||
// let items = slider.find('.slider-item');
|
||||
// let currentIndex = 0;
|
||||
//
|
||||
// function showSlide(index) {
|
||||
// items.removeClass('active');
|
||||
// $(items[index]).addClass('active');
|
||||
// }
|
||||
//
|
||||
// slider.siblings('.slider-prev').click(function () {
|
||||
// currentIndex = (currentIndex > 0) ? currentIndex - 1 : items.length - 1;
|
||||
// showSlide(currentIndex);
|
||||
// });
|
||||
//
|
||||
// slider.siblings('.slider-next').click(function () {
|
||||
// currentIndex = (currentIndex < items.length - 1) ? currentIndex + 1 : 0;
|
||||
// showSlide(currentIndex);
|
||||
// });
|
||||
//
|
||||
// // Initialize
|
||||
// showSlide(currentIndex);
|
||||
// });
|
||||
//});
|
||||
jQuery(document).ready(function($) {
|
||||
$('.product-image-slider').each(function() {
|
||||
let slider = $(this);
|
||||
let items = slider.find('.slider-item');
|
||||
let currentIndex = 0;
|
||||
|
||||
function showSlide(index) {
|
||||
items.removeClass('active');
|
||||
$(items[index]).addClass('active');
|
||||
}
|
||||
|
||||
slider.siblings('.slider-prev').click(function() {
|
||||
currentIndex = (currentIndex > 0) ? currentIndex - 1 : items.length - 1;
|
||||
showSlide(currentIndex);
|
||||
});
|
||||
|
||||
slider.siblings('.slider-next').click(function() {
|
||||
currentIndex = (currentIndex < items.length - 1) ? currentIndex + 1 : 0;
|
||||
showSlide(currentIndex);
|
||||
});
|
||||
|
||||
// Initialize
|
||||
showSlide(currentIndex);
|
||||
});
|
||||
});
|
||||
//
|
||||
//
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue