Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to specify foreground z index #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
4 changes: 2 additions & 2 deletions Scroller.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
export let offset = 0;
export let progress = 0;
export let visible = false;
export let foregroundZIndex = 2;

let outer;
let foreground;
Expand Down Expand Up @@ -176,7 +177,7 @@
</svelte-scroller-background>
</svelte-scroller-background-container>

<svelte-scroller-foreground bind:this={foreground}>
<svelte-scroller-foreground style="z-index: {foregroundZIndex}" bind:this={foreground}>
<slot name="foreground"></slot>
</svelte-scroller-foreground>
</svelte-scroller-outer>
Expand All @@ -196,7 +197,6 @@
svelte-scroller-foreground {
display: block;
position: relative;
z-index: 2;
}

svelte-scroller-foreground::after {
Expand Down