From 2698ef03a2396229c862739e7cbb3edbe9eabe1b Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Mon, 6 Sep 2021 11:30:23 +0200 Subject: [PATCH] Add scroll animation when switching slides --- assets/js/app.js | 4 ++++ views/stepper.twig.htm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/js/app.js b/assets/js/app.js index 64d70c8..7bbe076 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -133,6 +133,10 @@ window.stepper = { }, 500); } + jQuery('html, body').stop().animate({ + 'scrollTop': jQuery('#stepper-main').offset().top + }, 600, 'swing'); + this.$nextTick(function() { _self.$refs.slider.scrollLeft = _self.$refs.slider.scrollWidth / 4 * index; }); diff --git a/views/stepper.twig.htm b/views/stepper.twig.htm index ca0f36e..ae49e46 100644 --- a/views/stepper.twig.htm +++ b/views/stepper.twig.htm @@ -1,4 +1,4 @@ -