2.1.4 • Published 5 years ago
stuck-js v2.1.4
Stuck.js
A sticky library handles stack of stickies without dependencies(like jQuery) Demo: https://ryonkmr.github.io/stuck-js/
Quickstart
Setup
you can download from npm:
$ npm i -S stuck-js
or github releases.
Code
<style>
header {
height: 100px;
z-index: 100;
}
.ad {
width: 300px;
height: 250px;
}
</style>
<body>
<header style="height: 100px; z-index: 100;">
<h1>This is my first website</h1>
<!-- header contents -->
</header>
<div>
<main>
<!-- main contents -->
</main>
<div id="js-sidebar">
<aside class="js-sticky-ad ad ad--01"><!-- ad contents --></aside>
<aside class="js-sticky-ad ad ad--02"><!-- ad contents --></aside>
</div>
</div>
<script src="lib/stuck.js"></script>
<script>
const Stuck = StuckJs.Stuck;
const instances = new Stuck([
{ selector: '#js-header', marginTop: 0 },
{ selector: '.js-sticky-ad', wrapper: '#js-sidebar' },
], { marginTop: 10 });
</script>
</body>
2.1.4
5 years ago
2.1.3
5 years ago
2.1.2
5 years ago
2.1.1
5 years ago
2.1.0
5 years ago
0.7.1
6 years ago
0.7.0
6 years ago
0.6.0
6 years ago
0.5.0
6 years ago
0.4.1
6 years ago
0.4.0
6 years ago
0.3.1
6 years ago
0.3.0
6 years ago
0.2.2
6 years ago
0.2.1
6 years ago
0.2.0
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.1
6 years ago