HỆ THỐNG CỬA HÀNG PHÂN PHỐI YẾN SÀO BẮC NINH

jQuery(document).ready(function($) { // Selector cho các box địa điểm const $locationBoxes = $('.elementor-location-grid .elementor-location-item'); // Selector cho widget Google Map trong loop template const $mapWidgets = $('.elementor-google-map'); // Các selector để lấy thông tin địa điểm const SELECTORS = { address: '.location-address', // Địa chỉ map: '.elementor-google-map' // Selector cho widget map }; // Xử lý khi click vào box địa điểm $locationBoxes.on('click', function() { // Loại bỏ class active ở các box khác $locationBoxes.removeClass('active'); // Thêm class active cho box được chọn $(this).addClass('active'); // Lấy địa chỉ từ box địa điểm const address = $(this).find(SELECTORS.address).text().trim(); // Ẩn tất cả các map widget $mapWidgets.hide(); // Tìm và hiển thị map widget trong cùng box địa điểm $(this).find(SELECTORS.map).show(); }); // Mặc định chọn địa điểm đầu tiên khi tải trang $locationBoxes.first().trigger('click'); }); // Ghi chú: // 1. Script sẽ ẩn tất cả các widget map // 2. Chỉ hiển thị map của địa điểm được chọn // 3. Điều chỉnh SELECTORS nếu cấu trúc HTML khác
Hải Phòng Tất cả thành phố Hà Nội Bắc Ninh Hải Dương Quảng Ninh Hưng Yên Lào Cai Vĩnh Phúc Điện Biên Lai Châu
function filterByCity(city) { var url = new URL(window.location.href); if (city && city !== "hai-phong") { url.searchParams.set("city", city); } else { url.searchParams.delete("city"); } window.location.href = url.toString(); } document.addEventListener("DOMContentLoaded", function() { var urlParams = new URLSearchParams(window.location.search); var currentCity = urlParams.get("city") || "hai-phong"; var selectEl = document.getElementById("city-filter"); if (selectEl) { selectEl.value = currentCity; } });

Cửa hàng Yến Sào Bắc Ninh

Cửa hàng Yến Sào Bắc Ninh

Cửa hàng Yến Sào Bắc Ninh

Cửa hàng Yến Sào Bắc Ninh

Cửa hàng Yến Sào Bắc Ninh

Công ty Cổ phần Yến Sào Bắc Ninh

document.addEventListener('DOMContentLoaded', function() { const locations = document.querySelectorAll('.elementor-location-item'); const mapIframe = document.querySelector('#dynamic-map iframe'); locations.forEach((location, index) => { location.addEventListener('click', function() { // Xóa trạng thái active từ tất cả các phần tử locations.forEach(item => item.classList.remove('active-location')); // Thêm trạng thái active cho phần tử được nhấp this.classList.add('active-location'); // Lấy địa chỉ từ data-address const address = this.getAttribute('data-address'); // Cập nhật src của iframe với URL nhúng tiêu chuẩn if (mapIframe && address) { // Tạo URL nhúng động (không cần API key) const embedUrl = `https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d14885!2d105.123!3d21.123!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0!2s${encodeURIComponent(address)}!5e0!3m2!1svi!2s!4v1698765432!5m2!1svi!2s`; mapIframe.src = embedUrl; } }); }); // Hiển thị bản đồ của địa điểm đầu tiên khi trang tải (tùy chọn) if (locations.length > 0) { locations[0].click(); // Kích hoạt địa điểm đầu tiên } });