फ़ेल
केवल पिंच से ज़ूम होने वाला मैप
लाइव प्रीव्यू
// Two fingers are the only way to zoom this store map.const map = document.getElementById('store-map');let zoom = 1;let lastGap = 0;const gap = (t) => Math.hypot(t[0].clientX - t[1].clientX, t[0].clientY - t[1].clientY);map.addEventListener('touchmove', (e) => { if (e.touches.length !== 2) return; e.preventDefault(); const d = gap(e.touches); if (lastGap) zoom = Math.min(8, Math.max(1, zoom * d / lastGap)); lastGap = d; map.style.transform = 'scale(' + zoom + ')';});map.addEventListener('touchend', () => { lastGap = 0; });
पिंच एक मल्टीपॉइंट जेस्चर है, और ज़ूम कोड को और कुछ नहीं चलाता। जो केवल एक उँगली, माउथ स्टिक या हेड पॉइंटर इस्तेमाल कर सकता है, उसके पास ज़ूम करने का कोई तरीक़ा नहीं है।