'GB': { name: 'United Kingdom', standard: '12-20 business days', express: '5-10 business days' }, 'DE': { name: 'Germany', standard: '12-20 business days', express: '5-10 business days' }, 'FR': { name: 'France', standard: '12-20 business days', express: '5-10 business days' }, 'IT': { name: 'Italy', standard: '12-20 business days', express: '5-10 business days' }, 'ES': { name: 'Spain', standard: '12-20 business days', express: '5-10 business days' }, 'JP': { name: 'Japan', standard: '7-15 business days', express: '5-8 business days' }, 'KR': { name: 'South Korea', standard: '7-15 business days', express: '5-8 business days' }, 'AU': { name: 'Australia', standard: '10-18 business days', express: '6-10 business days' }, 'CA': { name: 'Canada', standard: '15-25 business days', express: '7-12 business days' }, 'BR': { name: 'Brazil', standard: '25-40 business days', express: '15-25 business days' }, 'RU': { name: 'Russia', standard: '20-35 business days', express: '12-20 business days' }, 'IN': { name: 'India', standard: '15-30 business days', express: '10-18 business days' }, 'MX': { name: 'Mexico', standard: '20-35 business days', express: '12-22 business days' }, 'AE': { name: 'United Arab Emirates', standard: '10-18 business days', express: '6-10 business days' }, 'SA': { name: 'Saudi Arabia', standard: '12-22 business days', express: '8-15 business days' }, 'SG': { name: 'Singapore', standard: '7-12 business days', express: '4-7 business days' } }; // Get country code from cookie, default to US if not set function getCountryFromCookie() { let countryCode = getCookie('user_country'); if (!countryCode || !deliveryTimes[countryCode]) { countryCode = 'US'; // Default value setCookie('user_country', countryCode, 30); // Save for 30 days } return countryCode; } // Update the delivery info display on page function updateDeliveryDisplay(countryCode) { const countryInfo = deliveryTimes[countryCode]; $('#currentCountry').text(countryInfo.name); $('#currentStandardTime').text(countryInfo.standard); $('#currentExpressTime').text(countryInfo.express); } // Initialize the page $(document).ready(function() { // Get country from cookie and update display const currentCountry = getCountryFromCookie(); updateDeliveryDisplay(currentCountry); // Open modal and set current country selection $('#changeCountryBtn').click(function() { $('#countryModal').removeClass('hidden'); $('#countrySelect').val(currentCountry); updateDeliveryEstimate(currentCountry); // Prevent background scrolling when modal is open $('body').css('overflow', 'hidden'); }); // Close modal $('#closeModalBtn').click(function() { $('#countryModal').addClass('hidden'); $('body').css('overflow', 'auto'); }); // Close modal when clicking outside $('#countryModal').click(function(e) { if (e.target === this) { $(this).addClass('hidden'); $('body').css('overflow', 'auto'); } }); // Update delivery estimate when country changes $('#countrySelect').change(function() { const countryCode = $(this).val(); updateDeliveryEstimate(countryCode); }); // Confirm country selection $('#confirmBtn').click(function() { const selectedCountry = $('#countrySelect').val(); if (selectedCountry && deliveryTimes[selectedCountry]) { setCookie('user_country', selectedCountry, 30); // Save for 30 days updateDeliveryDisplay(selectedCountry); $('#countryModal').addClass('hidden'); $('body').css('overflow', 'auto'); } }); // Update delivery estimate in modal function updateDeliveryEstimate(countryCode) { if (countryCode && deliveryTimes[countryCode]) { $('#standardDelivery').text(deliveryTimes[countryCode].standard); $('#expressDelivery').text(deliveryTimes[countryCode].express); } else { $('#standardDelivery').text('Select country'); $('#expressDelivery').text('Select country'); } } // Better handling of virtual keyboard on mobile $(window).on('resize', function() { if ($(window).width() < 768) { $('#countrySelect').blur(); } }); });

Reviews(0)
0.00
Image 0 Positive 0
See All Reviews
Questions & Answers(0)

You also Interesting

Glass cover immortal rose
More like this
More like this
Glass cover immortal rose
4.3
$29.67 $69.00
7223
Cupid Bear Everlasting Flower Gift Box
More like this
More like this
Cupid Bear Everlasting Flower Gift Box
3.9
$124.27 $289.00
6725
24K gold foil rose
More like this
24K gold foil rose
4.0
$29.24 $68.00
6500
Glass cover immortal rose
More like this
More like this
Glass cover immortal rose
4.3
$158.67 $369.00
6425
Confession Bear Eternal Rose Gift Box
More like this
More like this
Confession Bear Eternal Rose Gift Box
4.5
$158.67 $369.00
6703
Soap Rose Gift Box
More like this
Soap Rose Gift Box
4.7
$8.56 $19.90
6670
Rose Bear Preserved Flower Gift Box
More like this
More like this
Rose Bear Preserved Flower Gift Box
4.4
$128.57 $299.00
6229
Rose Bear Preserved Flower Gift Box
More like this
More like this
Rose Bear Preserved Flower Gift Box
5.0
$124.27 $289.00
6714

(6907)
(0)

Roymall Service

QQ好友QQ空间新浪微博微信朋友圈百度贴吧复制链接
取消