1var swiper = new Swiper(".mySlider", { 2 loop: true, 3 autoplay: { 4 delay: 2500, // thá»i gian giữa các slide (ms) 5 disableOnInteraction: false, // cho phép tiếp tục autoplay khi ngưá»i dùng tương tác 6 }, 7 scrollbar: { 8 el: ".swiper-scrollbar", 9 hide: true, 10 }, 11}); 12 13// Hà m chuyá»n Äá»i sá» rating thà nh chuá»i HTML chứa các ảnh sao 14function convertRatingToStars(rating) { 15 const maxStars = 5; 16 let starsHTML = ''; 17 18 for (let i = 1; i <= maxStars; i++) { 19 if (i <= rating) { 20 starsHTML += '<i class="icon-star"></i>'; 21 } else { 22 starsHTML += '<i class="icon-star-o"></i>'; 23 } 24 } 25 26 return starsHTML; 27} 28 29// Lấy tất cả các phần tá» có class "rating" và cáºp nháºt HTML theo data-stars 30const ratingElements = document.getElementsByClassName("rating"); 31for (let element of ratingElements) { 32 const ratingValue = element.getAttribute("data-stars"); 33 if (ratingValue) { 34 // Chuyá»n chuá»i thà nh sá» tháºp phân 35 let ratingDecimal = parseFloat(ratingValue); 36 // Chuyá»n sá» tháºp phân thà nh sá» nguyên (là m tròn) 37 let ratingInteger = Math.round(ratingDecimal); 38 element.innerHTML = convertRatingToStars(ratingInteger); 39 } 40} 41document.addEventListener('DOMContentLoaded', function () { 42 var viewMoreBtn = document.getElementById('view_more'); 43 if(viewMoreBtn) { 44 viewMoreBtn.addEventListener('click', function () { 45 var contentDetail = document.querySelector('.content-detail'); 46 contentDetail.classList.add('expanded'); 47 // Ẩn nút "Xem thêm" sau khi click nếu cần 48 viewMoreBtn.style.display = 'none'; 49 }); 50 } 51}); 52
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.