Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

catalog - pagination scroll top

DanielŻuławski382c241a247a
diff --git a/src/Web/Grand.Web/Views/Catalog/_ModelScript.cshtml b/src/Web/Grand.Web/Views/Catalog/_ModelScript.cshtml
index 153d36e6f..bd12fb2fa 100644
--- a/src/Web/Grand.Web/Views/Catalog/_ModelScript.cshtml
+++ b/src/Web/Grand.Web/Views/Catalog/_ModelScript.cshtml
@@ -37,8 +37,16 @@
let urlPagenumber = new URL(window.location.href);
urlPagenumber.searchParams.set('pagenumber', page);
catalog.loadProducts(urlPagenumber.href);
+ this.scrollToSection();
},
-
+ scrollToSection() {
+ var container = document.getElementById("catalog-products");
+ window.scrollTo({
+ top: container.offsetTop,
+ left: 0,
+ behavior: 'smooth'
+ });
+ }
},
created() {
this.Model = @Model;