Skip to the end of the images gallery
×
→
←
' + '
+
-
'; const first = images[0].src, last = images[l - 1].src; const imgContainer = document.querySelector(".gg-image-container"), imgScroll = document.querySelector(".gg-image-scroll"), prevBtn = document.querySelector(".gg-prev"), nextBtn = document.querySelector(".gg-next"), close = document.querySelector(".gg-close"), zoomInBtn = document.querySelector(".gg-zoom-in"), zoomOutBtn = document.querySelector(".gg-zoom-out"); imgContainer.style.height = "100%"; imgScroll.style.height = "100%"; imgScroll.style.overflow = "auto"; imgScroll.style.maxHeight = "1000px"; currentIndex = Array.from(images).indexOf(currentImg[0]); if (l > 1) { if (route == first) { prevBtn.hidden = true; nextImg = self.nextSibling?.children[0]; } else if (route == last) { nextBtn.hidden = true; prevImg = self.previousSibling?.children[0]; } else { prevImg = self.previousSibling?.children[0]; nextImg = self.nextSibling?.children[0]; } } else { prevBtn.hidden = true; nextBtn.hidden = true; } screenItem.addEventListener("click", function(e) { if (e.target == this || e.target == close) hide(); if (e.target == close) { let totop = document.getElementById('totop'); totop.style.display = "block"; resetZoom(); } }); root.addEventListener("keydown", function(e) { if (e.keyCode == 37 || e.keyCode == 38) prev(); if (e.keyCode == 39 || e.keyCode == 40) next(); if (e.keyCode == 27) hide(); if (e.key == '+') zoomIn(); if (e.key == '-') zoomOut(); }); prevBtn.addEventListener("click", prev); nextBtn.addEventListener("click", next); zoomInBtn.addEventListener("click", zoomIn); zoomOutBtn.addEventListener("click", zoomOut); imgContainer.addEventListener("mousedown", startDrag); document.addEventListener("mousemove", drag); document.addEventListener("mouseup", endDrag); function startDrag(e) { if (currentZoom > 1) { isDragging = true; startY = e.clientY; currentY = imgScroll.scrollTop; } } function drag(e) { if (isDragging) { const deltaY = e.clientY - startY; const newScrollTop = currentY - deltaY; imgScroll.scrollTop = newScrollTop; } } function endDrag() { isDragging = false; } function prev() { currentIndex--; currentImg = images[currentIndex]; imgScroll.innerHTML = ''; nextBtn.hidden = false; prevBtn.hidden = currentIndex === 0; resetZoom(); } function next() { currentIndex++; currentImg = images[currentIndex]; imgScroll.innerHTML = ''; prevBtn.hidden = false; nextBtn.hidden = currentIndex === l - 1; resetZoom(); } function zoomIn() { currentZoom += 0.1; updateZoom(); } function zoomOut() { if (currentZoom > 1) { currentZoom -= 0.1; updateZoom(); } } function updateZoom() { const mobileScreenWidth = 990; if (window.innerWidth >= mobileScreenWidth) { const marginTop = (imgScroll.clientHeight - imgScroll.clientHeight / currentZoom) / 2; imgScroll.style.transform = `scale(${currentZoom}) translateY(${marginTop}px)`; const maxHeight = imgScroll.scrollHeight / currentZoom; imgScroll.style.maxHeight = maxHeight + "px"; } else { imgScroll.style.transform = `scale(${currentZoom}) translateY(0)`; imgScroll.style.maxHeight = "none"; } } function resetZoom() { currentZoom = 1; updateZoom(); } function hide() { root.style.overflow = 'auto'; screenItem.remove(); document.body.classList.remove("image-clicked"); } }); } function gridGallery(options) { if (options.selector) selector = document.querySelector(options.selector); if (options.darkMode) selector.setAttribute("data-theme", "dark"); if (options.layout == "horizontal" || options.layout == "square") selector.setAttribute("data-layout", options.layout); if (options.gaplength) selector.style.setProperty('--gap-length', options.gaplength + 'px'); if (options.rowHeight) selector.style.setProperty('--row-height', options.rowHeight + 'px'); if (options.columnWidth) selector.style.setProperty('--column-width', options.columnWidth + 'px'); }
Skip to the beginning of the images gallery
Oakley
AED999.00
We Extended the Field of View in the Upper Peripheral Region to Optimize it for Cycling, and Once We Added Switchlock Technology for Easy Lens Changing Plus Temples That Adjust to Three Different Lengths for Helmet Compatibility, Jawbreaker Became the Ultimate Sport Design.
Availability: In stock
SKU
O010OO9290-7931
"); } else if (dealstartdate > currentdate) { $('.countdowncontainer').hide(); var msg = "
Coming Soon..
Deal Start at:
" + $('#' + startdateid).val() + "
"; $('#expired').html(msg); } else { var days = Math.floor(distance / _day); var hours = Math.floor((distance % _day) / _hour); var minutes = Math.floor((distance % _hour) / _minute); var seconds = Math.floor((distance % _minute) / _second); if (hours < 10) hours = "0" + hours; if (minutes < 10) minutes = "0" + minutes; if (seconds < 10) seconds = "0" + seconds; $('.countdowncontainer').show(); $('#' + daysid).html(days); $('#' + hoursid).html(hours); $('#' + minutesid).html(minutes); $('#' + secondsid).html(seconds); } } //Set date as magentodatetime var date = new Date('2024-04-19 12:25:57'); if (app.isAppleDevice()) { var mdate = '2024-04-19 12:25:57'; var dateParts = mdate.substring(0, 10).split('-'); var timePart = mdate.substr(11); date = dateParts[1] + '/' + dateParts[2] + '/' + dateParts[0] + ' ' + timePart; date = new Date(date); } var day = date.getDate(); var month = date.getMonth(); var year = date.getFullYear(); var hours = date.getHours(); var minutes = "0" + date.getMinutes(); var seconds = "0" + date.getSeconds(); var fulldate = year + '/' + (month + 1) + '/' + day + ' ' + hours + ':' + minutes.substr(minutes.length - 2) + ':' + seconds.substr(seconds.length - 2); // Set Interval timer = setInterval(function() { date.setSeconds(date.getSeconds() + 1); var month = date.getMonth(); var currentdatetime = date.getFullYear() + "/" + (month + 1) + "/" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); showRemaining(currentdatetime); }, 1000); });
Add to Wish List
Details
More Information
Related Posts