
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Sticky-js is a library for sticky elements written in vanilla javascript. With this library you can easily set sticky elements on your website. It's also responsive.
npm install sticky-js
bower install sticky.js
Simply include
<script src="sticky.min.js"></script>
Then have element
<div class="selector">Sticky element</div>
Initialize in javascript
var sticky = new Sticky('.selector');
Syntax
new Sticky([selector:string], [global options:object])
CommonJS
var Sticky = require('sticky-js');
var sticky = new Sticky('.selector');
Multiple sticky elements with data-sticky-container and options
<div class="row" data-sticky-container>
<div class="medium-2 columns">
<img src="http://placehold.it/250x250" class="sticky" data-margin-top="20" data-sticky-for="1023" data-sticky-class="is-sticky">
</div>
<div class="medium-8 columns">
<h1>Sticky-js</h1>
<p>Lorem ipsum.....</p>
</div>
<div class="medium-2 columns">
<img src="http://placehold.it/250x250" class="sticky" data-margin-top="20" data-sticky-for="1023" data-sticky-class="is-sticky">
</div>
</div>
<script src="sticky.min.js"></script>
<script>
var sticky = new Sticky('.sticky');
</script>
Update sticky, e.g. when parent container (data-sticky-container) change height
var sticky = new Sticky('.sticky');
// and when parent change height..
sticky.update();
Destroy sticky element
var sticky = new Sticky('.sticky');
sticky.destroy();
Option | Type | Default | Description |
---|---|---|---|
data-sticky-wrap | boolean | false | When it's true sticky element is wrapped in <span></span> which has sticky element dimensions. Prevents content from "jumping". |
data-margin-top | number | 0 | Margin between page and sticky element when scrolled |
data-sticky-for | number | 0 | Breakpoint which when is bigger than viewport width, sticky is activated and when is smaller, then sticky is destroyed |
data-sticky-class | string | null | Class added to sticky element when it is stuck |
Clone this repository and run
npm start
Library is using ECMAScript 5 features.
If you need this library working with older browsers you should use ECMAScript 5 polyfill.
https://rgalus.github.io/sticky-js/
FAQs
Sticky elements
The npm package sticky-js receives a total of 9,850 weekly downloads. As such, sticky-js popularity was classified as popular.
We found that sticky-js 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
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.