diff --git a/CHANGES.md b/CHANGES.md
index 376b1a388..7441d1e08 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -5,9 +5,9 @@
Features
~~~~~~~~
+- pat-scroll-box: New pattern for scrolling detection. Replaces the previous "scroll detection" module.
- pat-inject: Rename undocumented ``selector`` property to ``defaultSelector``.
- pat-inject: Fix typo in docs for the ``source`` property.
-- scroll detection: Rework and optimize, set scroll classes on any scrolling event, fix problem with IE and set initial state. Fixes #701
- pat-scroll: Implement new special `selector:top` attribute value to scroll the scroll container just to the top of the page. Ref: #721.
- pat-scroll: To define the scrollable target search also for `overflow-x` and `overflow-y` declarations.
- Rework push message support for the STOMP message protocoll instead of backends instead of WAMP.
diff --git a/src/core/scroll_detection.js b/src/core/scroll_detection.js
deleted file mode 100644
index edb19e3a1..000000000
--- a/src/core/scroll_detection.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Patterns scroll detection - convenience classes requested in #701
- *
- * Copyright 2020- Alexander Pilz, Syslab.com GmbH
- */
-
-define([
- "jquery"
-], function($) {
- var scroll_detection = {
-
- init: function () {
-
- let last_known_scroll_position = 0;
- let scroll_y = 0;
- let ticking = false;
-
- let set_scroll_classes = (scroll_pos) => {
- document.body.classList.remove("scroll-up");
- document.body.classList.remove("scroll-down");
- document.body.classList.remove("scroll-position-top");
- document.body.classList.remove("scroll-position-bottom");
-
- if (scroll_pos < last_known_scroll_position) {
- document.body.classList.add("scroll-up");
- } else if (last_known_scroll_position < scroll_pos) {
- document.body.classList.add("scroll-down");
- }
-
- if (scroll_pos === 0) {
- document.body.classList.add("scroll-position-top");
- } else if ((window.innerHeight + scroll_pos) >= document.body.offsetHeight) {
- document.body.classList.add("scroll-position-bottom");
- }
- }
-
- window.addEventListener('scroll', (e) => {
- // In case that's needed sometime:
- // ``e.target.scrollTop`` would be the scrolling position of the DOM element.
- // We're interested in the window scrolling position though.
- if (!ticking) {
- // Don't redo while we're already modifying the DOM.
- window.requestAnimationFrame(() => {
- scroll_y = this.get_scroll_y();
- set_scroll_classes(scroll_y);
- last_known_scroll_position = scroll_y;
- ticking = false;
- });
- ticking = true;
- }
- });
-
- // Set initial state
- $().ready(() => set_scroll_classes(this.get_scroll_y()));
-
- },
-
- get_scroll_y: () => {
- return window.scrollY !== undefined ? window.scrollY : window.pageYOffset; // pageYOffset for IE
- }
-
- };
-
- scroll_detection.init();
- return scroll_detection;
-});
diff --git a/src/pat/scroll-box/documentation.md b/src/pat/scroll-box/documentation.md
new file mode 100644
index 000000000..b93117a7a
--- /dev/null
+++ b/src/pat/scroll-box/documentation.md
@@ -0,0 +1,15 @@
+## Description
+
+The *scroll box* pattern adds some CSS classes to the element depending on it's scrolling position.
+
+The element where it is invoked upon has to be scrollable.
+Therefore the eleme must have set the ``overflow`` or ``overflowY`` CSS property set to ``auto`` or ``scroll``.
+Ho(horizontal scrolling is not yet supported.
+
+The classes are:
+
+- ``scroll-up``: when scrolling upwards,
+- ``scroll-down``: when scrolling downwards,
+- ``scroll-position-top``: when the scrolling container is scrolled to the top,
+- ``scroll-position-bottom``: when the scrolling container is scrolled to the bottom.
+
diff --git a/src/pat/scroll-box/index.html b/src/pat/scroll-box/index.html
new file mode 100644
index 000000000..9e08a123a
--- /dev/null
+++ b/src/pat/scroll-box/index.html
@@ -0,0 +1,54 @@
+
+
+