arrow_upward
/* =====================================
DHEKI BAZAR - WEBSITE ENHANCEMENTS
===================================== */
document.addEventListener("DOMContentLoaded", function () {
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(function (link) {
link.addEventListener("click", function (event) {
const target = document.querySelector(
this.getAttribute("href")
);
if (target) {
event.preventDefault();
target.scrollIntoView({
behavior: "smooth",
block: "start"
});
}
});
});
// Lazy loading for images
document.querySelectorAll("img").forEach(function (img) {
if (!img.hasAttribute("loading")) {
img.setAttribute("loading", "lazy");
}
});
});