
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
ember-sliding-sticky
Advanced tools
A `position: sticky` alternative that works inside parents with `overflow: hidden`
A drop-in implementation for sticky elements. By default, uses transform: translate3d(0, Npx, 0)
to position sticky elements.
Pros
position: sticky
, works fine inside parents that have overflow
and/or transform
.position: fixed
, when your scroll container is shorter than viewport and the sticky element is taller, the sticky element never overflows out of parent.transition: transform 0.5s ease
to your sticky element.Cons
Restrictions
Requires a sticky element to be initially located at the top of its immediate parent, so that the whole parent's inner height is available for the sticky element to roam.
One possible way to achieve this is to apply the following CSS to the immediate parent of the sticky element:
display: flex;
align-items: flex-start;
https://github.com/Deveo/ember-sliding-sticky/graphs/contributors
With npm: ember i ember-sticky-container
With Yarn: yarn add -D ember-sticky-container
In a template, replace an HTML element you want to be sticky with the sliding-sticky
component.
Before:
<div>My sidebar</div>
After:
{{#sliding-sticky}}
My sidebar
{{/sliding-sticky}}
Alternatively, you can apply the sliding sticky mixin to your components:
import Component from 'ember-component'
import SlidingStickyMixin from 'ember-sliding-sticky/mixin'
export default Component.extend(SlidingStickyMixin, {
// ...
})
By applying transition: transform 0.5s ease
CSS to your sticky elements, you can make them appear static while you're scrolling, but when you stop scrolling, the elements smoothly slide back into view.
If you go for this effect, it's highly recommended to enable throttling (see below), it will prevent scrolling from appear laggy on slow systems. Throttling is disabled by default because without animation it causes the sticky element to jitter.
Option | Type | Default value | Description |
---|---|---|---|
slidingStickyScrollParent | selector string, DOM element or jQuery collection | window | Which scroll container to use. |
slidingStickyThrottleDuration | Number | 0 | Throttle duration in milliseconds. 0 disables throttling. Set to 100 or so if you're using the transition animation. |
Option | Arguments | Description |
---|---|---|
slidingStickyApplyPosition | positionPx (number of pixels) | Lets you customize the way the element is positioned. By default, applies transform: translate3d(0, Npx, 0) inline CSS to the element. |
slidingStickyTransitionEnd | none | Lets you react when the element finishes positioning. This is only useful when you apply transition: transform to the element. |
Proudly built in @Deveo by @lolmaus and contributors.
[1.0.0] - 2017.04.20
Initial release.
FAQs
A `position: sticky` alternative that works inside parents with `overflow: hidden`
The npm package ember-sliding-sticky receives a total of 0 weekly downloads. As such, ember-sliding-sticky popularity was classified as not popular.
We found that ember-sliding-sticky demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.