var counselors = [ { "id": "24", "created_at": "2019-12-31 03:04:43", "name": "Chị Nguyễn Hồng Kha", "position": "Chuyên viên tư vấn", "experience": "6 năm", "image": "https://ats.org.vn/storage/media/1hiYWzc01Kne08GffOSCxLS74K5zpuHuRVzuRLmh.jpeg" }, { "id": "22", "created_at": "2019-12-27 06:52:12", "name": "Chị Nguyễn Bích Huệ", "position": "Giám đốc ATS Đà Nẵng", "experience": "2 năm", "image": "https://ats.org.vn/storage/media/FpITrxQfD03no7R10IXRblyuI7fhgugliwiETM4D.png" }, { "id": "21", "created_at": "2019-12-26 07:53:35", "name": "Chị Ngô Thanh Hằng", "position": "Chuyên viên tư vấn", "experience": "2 năm", "image": "https://ats.org.vn/storage/media/wt0x74c1LBKJvxgmvcH8MesPxTZfvDuIvZ1D7w2y.png" }, { "id": "19", "created_at": "2019-12-11 09:06:59", "name": "Chị Nguyễn Hoàng Nhi", "position": "Chuyên viên tư vấn", "experience": "5 năm", "image": "https://ats.org.vn/storage/media/gBwe0mcphyrDJfgGcXrbnu1Z6zZ83bnHACpul3Xv.jpeg" }, { "id": "16", "created_at": "2019-12-11 09:04:02", "name": "Chị Trần Huỳnh Mai", "position": "Chuyên viên tư vấn", "experience": "5 năm", "image": "https://ats.org.vn/storage/media/yLohhgBa1X0k5MPYhnz4PLpiUM7u2K9a517Jezrk.jpeg" }, { "id": "13", "created_at": "2019-11-14 08:31:08", "name": "Cô Trần Tường Nhi", "position": "Tổng Giám Đốc", "experience": "22 năm", "image": "https://ats.org.vn/storage/media/axMRnO1ywLmfuBYtMxaKAnatc9upOyAaqgp2Vp7h.jpeg" }, { "id": "12", "created_at": "2019-11-14 08:30:11", "name": "Anh Phạm Đỗ Thắng", "position": "Trưởng phòng phát triển kinh doanh", "experience": "14 năm", "image": "https://ats.org.vn/storage/media/QKgmEQqicBGapwvKafgoWDqW9lQ5L14ggAAShhfi.jpeg" }, { "id": "10", "created_at": "2019-11-14 08:22:07", "name": "Cô Nguyễn Trung Hà", "position": "Giám đốc ATS Hà Nội", "experience": "20 năm", "image": "https://ats.org.vn/storage/media/OdGYpkhhA9wy9VNDFqobG35g5VVu0SD5yMOiqvoY.jpeg" }, { "id": "8", "created_at": "2019-11-14 08:19:25", "name": "Chị Lý Kim Ngọc", "position": "Chuyên viên tư vấn", "experience": "2 năm", "image": "https://ats.org.vn/storage/media/no5aJQn7lHK8EdliZxEQSOOan4aN2DCDJJOmIsfd.jpeg" } ]; const swiper = new Swiper("#swiper1", { slidesPerView: calculateSlidesPerView(), spaceBetween: 20, pagination: { el: ".swiper-pagination", type: "fraction", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, autoplay: 2500, virtual: { slides: (function () { const slides = counselors?.map(item => { return `
` }); return slides; })(), }, }); window.addEventListener("resize", function () { swiper.params.slidesPerView = calculateSlidesPerView(); swiper.update(); }); function calculateSlidesPerView() { return window.innerWidth <= 991 ? 3 : 6; } const swiper_courses2 = new Swiper("#swiper2", { slidesPerView: 4, spaceBetween: 20, pagination: { el: ".swiper-pagination", type: "fraction", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, virtual: { slides: (function () { const slides = ['','','','']?.map(item => { return `
` }); return slides; })(), }, }); window.addEventListener("resize", function () { swiper_courses2.params.slidesPerView = calculateSlidesPerView(); swiper_courses2.update(); }); function calculateSlidesPerView() { return window.innerWidth <= 991 ? 3 : 6; }