From 4064af1bbc2e876caf1c0856524c83d9729e8fad Mon Sep 17 00:00:00 2001 From: Alvin Bryan <107407814+alvinometric@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:27:21 +0000 Subject: [PATCH] Added option to specify foreground z index --- README.md | 1 + Scroller.svelte | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad9dda9..8705e2a 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ The following parameters are available: | threshold | 0.5 | Once a section crosses this point, it becomes 'active' | | query | 'section' | A CSS selector that describes the individual sections of your foreground | | parallax | false | If `true`, the background will scroll such that the bottom edge reaches the `bottom` at the same time as the foreground. This effect can be unpleasant for people with high motion sensitivity, so use it advisedly | +| foregroundZIndex | 2 | lets you specify the z-index of the foreground | ## `index`, `offset`, `progress` and `count` diff --git a/Scroller.svelte b/Scroller.svelte index b2285c2..37842d3 100644 --- a/Scroller.svelte +++ b/Scroller.svelte @@ -76,6 +76,7 @@ export let offset = 0; export let progress = 0; export let visible = false; + export let foregroundZIndex = 2; let outer; let foreground; @@ -176,7 +177,7 @@ - + @@ -196,7 +197,6 @@ svelte-scroller-foreground { display: block; position: relative; - z-index: 2; } svelte-scroller-foreground::after {