How to make 3 checkboxes on one slide?

`

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>document.addEventListener('DOMContentLoaded', function () {
const contentProductsSwiper = new Swiper('.products-list__header', {
slidesPerView: 1,
loop: true,
speed: 300,
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
/**
* Custom function for rendering pagination points.
* Returns the HTML code for each point.
* */
renderBullet: function (index, className) {
/**
* Generates HTML code for the pagination point.
* Uses the class provided by Swiper and adds the point number.
* */
return '<span class="' + className + '">' + (index + 1) + '</span>';
},
},
// Swiper event
on: {
// Event triggered when the slide changes
slideChange: function () {
// Get all pagination points
const bullets = document.querySelectorAll('.swiper-pagination-bullet');
// Total number of pagination points
const totalBullets = bullets.length;
// Index of the current active slide
const activeIndex = this.realIndex;
if (totalBullets > 0) {
// Remove the active class from all pagination points
bullets.forEach(bullet => bullet.classList.remove('swiper-pagination-bullet-active'));
// Add the active class to the current and next two pagination points
for (let i = 0; i < 3; i++) {
/**
* Calculates the pagination point index by adding the current active index and offset,
* then takes the remainder of the division by the total number of points.
* */
const bulletIndex = (activeIndex + i) % totalBullets;
// Checking the existence of an element in NodeList bullets
if (bullets[bulletIndex]) {
bullets[bulletIndex].classList.add('swiper-pagination-bullet-active');
}
};
}
},
},
});
// Initially set the active class for the first three pagination points
// const initialBullets = document.querySelectorAll('.swiper-pagination-bullet');
for (let i = 0; i < 3; i++) {
// Check if the pagination point exists
if (initialBullets[i]) {
// Add an active class
initialBullets[i].classList.add('swiper-pagination-bullet-active');
}
};
});
</code>
<code>document.addEventListener('DOMContentLoaded', function () { const contentProductsSwiper = new Swiper('.products-list__header', { slidesPerView: 1, loop: true, speed: 300, pagination: { el: '.swiper-pagination', type: 'bullets', clickable: true, /** * Custom function for rendering pagination points. * Returns the HTML code for each point. * */ renderBullet: function (index, className) { /** * Generates HTML code for the pagination point. * Uses the class provided by Swiper and adds the point number. * */ return '<span class="' + className + '">' + (index + 1) + '</span>'; }, }, // Swiper event on: { // Event triggered when the slide changes slideChange: function () { // Get all pagination points const bullets = document.querySelectorAll('.swiper-pagination-bullet'); // Total number of pagination points const totalBullets = bullets.length; // Index of the current active slide const activeIndex = this.realIndex; if (totalBullets > 0) { // Remove the active class from all pagination points bullets.forEach(bullet => bullet.classList.remove('swiper-pagination-bullet-active')); // Add the active class to the current and next two pagination points for (let i = 0; i < 3; i++) { /** * Calculates the pagination point index by adding the current active index and offset, * then takes the remainder of the division by the total number of points. * */ const bulletIndex = (activeIndex + i) % totalBullets; // Checking the existence of an element in NodeList bullets if (bullets[bulletIndex]) { bullets[bulletIndex].classList.add('swiper-pagination-bullet-active'); } }; } }, }, }); // Initially set the active class for the first three pagination points // const initialBullets = document.querySelectorAll('.swiper-pagination-bullet'); for (let i = 0; i < 3; i++) { // Check if the pagination point exists if (initialBullets[i]) { // Add an active class initialBullets[i].classList.add('swiper-pagination-bullet-active'); } }; }); </code>
document.addEventListener('DOMContentLoaded', function () {
    const contentProductsSwiper = new Swiper('.products-list__header', {
        slidesPerView: 1,
        loop: true,
        speed: 300,
        pagination: {
            el: '.swiper-pagination',
            type: 'bullets',
            clickable: true,
            /**
            * Custom function for rendering pagination points.
            * Returns the HTML code for each point.
            * */
            renderBullet: function (index, className) {
                /**
                * Generates HTML code for the pagination point.
                * Uses the class provided by Swiper and adds the point number.
                * */
                return '<span class="' + className + '">' + (index + 1) + '</span>';
            },
        },
        // Swiper event
        on: {
            // Event triggered when the slide changes
            slideChange: function () {
                // Get all pagination points
                const bullets = document.querySelectorAll('.swiper-pagination-bullet');
                // Total number of pagination points
                const totalBullets = bullets.length;
                // Index of the current active slide
                const activeIndex = this.realIndex;

                if (totalBullets > 0) {
                    // Remove the active class from all pagination points
                    bullets.forEach(bullet => bullet.classList.remove('swiper-pagination-bullet-active'));

                    // Add the active class to the current and next two pagination points
                    for (let i = 0; i < 3; i++) {
                        /**
                        * Calculates the pagination point index by adding the current active index and offset,
                        * then takes the remainder of the division by the total number of points.
                        * */
                        const bulletIndex = (activeIndex + i) % totalBullets;
                        // Checking the existence of an element in NodeList bullets

                        if (bullets[bulletIndex]) {
                            bullets[bulletIndex].classList.add('swiper-pagination-bullet-active');
                        }
                    };
                }
            },
        },
    });

    // Initially set the active class for the first three pagination points
    // const initialBullets = document.querySelectorAll('.swiper-pagination-bullet');
    for (let i = 0; i < 3; i++) {
        // Check if the pagination point exists
        if (initialBullets[i]) {
            // Add an active class
            initialBullets[i].classList.add('swiper-pagination-bullet-active');
        }
    };
});

You need to do it like in the picture
I tried to do this:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>const swiper = new Swiper('.swiper-container', {
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
renderBullet: function(index, className) {
return `<span class="${className}">${index + 1}</span>`;
}
},
slidePreview: 1,
slidesPerView: 1,
slidesPerColumn: 3,
});
</code>
<code>const swiper = new Swiper('.swiper-container', { pagination: { el: '.swiper-pagination', type: 'bullets', clickable: true, renderBullet: function(index, className) { return `<span class="${className}">${index + 1}</span>`; } }, slidePreview: 1, slidesPerView: 1, slidesPerColumn: 3, }); </code>
const swiper = new Swiper('.swiper-container', {
  pagination: {
    el: '.swiper-pagination',
    type: 'bullets',
    clickable: true,
    renderBullet: function(index, className) {
      return `<span class="${className}">${index + 1}</span>`;
    }
  },
  slidePreview: 1,
  slidesPerView: 1,
  slidesPerColumn: 3,
});

I have three slides, that is, 3 pictures of a product card. But you need one picture to display the product
If the buyer wants to see other photos of the product, then he needs to click on the flags below. And there should be 3 of them, although in the Swiper settings there is slidesPerView: 1

It should look like the photo I provided above

How to solve this problem?
I will be glad to help

`

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật