Installations
npm install @lighting-beetle/glider-js
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
14.17.3
NPM Version
6.14.13
Score
76.9
Supply Chain
99.1
Quality
79.3
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (69.22%)
HTML (20.77%)
CSS (10.01%)
Developer
Download Statistics
Total Downloads
4,842
Last Day
22
Last Week
103
Last Month
290
Last Year
2,226
GitHub Statistics
238 Commits
1 Watching
6 Branches
Bundle Size
8.34 kB
Minified
2.91 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.8.2
Package Id
@lighting-beetle/glider-js@1.8.2
Unpacked Size
1.55 MB
Size
777.07 kB
File Count
69
NPM Version
6.14.13
Node Version
14.17.3
Total Downloads
Cumulative downloads
Total Downloads
4,842
Last day
100%
22
Compared to previous day
Last week
83.9%
103
Compared to previous week
Last month
100%
290
Compared to previous month
Last year
44.8%
2,226
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
6
Glider.js
A fast, light-weight, dependency free, responsive, accessible, extendable, native scrolling list with paging controls, methods and events. (< 2.8kb gzipped!)
Demos and full documentation available on Github Pages: https://nickpiscitelli.github.io/Glider.js/
Quick Start
Include glider.min.css:
1<link rel="stylesheet" href="glider.min.css"> 2or 3<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/glider-js@1/glider.min.css">
Include Glider.js:
1<script src="glider.min.js"></script> 2or 3<script src="https://cdn.jsdelivr.net/npm/glider-js@1/glider.min.js"></script>
Example HTML:
1<div class="glider"> 2 <div> 1 </div> 3 <div> 2 </div> 4 <div> 3 </div> 5 <div> 4 </div> 6 <div> 5 </div> 7 <div> 6 </div> 8</div>
Glider.js Initialization
1new Glider(document.querySelector('.glider'));
Glider.js Initialization w/ full options:
1new Glider(document.querySelector('.glider'), { 2 3 // `auto` allows automatic responsive 4 // width calculations 5 slidesToShow: 'auto', 6 slidesToScroll: 'auto', 7 8 // should have been named `itemMinWidth` 9 // slides grow to fit the container viewport 10 // ignored unless `slidesToShow` is set to `auto` 11 itemWidth: undefined, 12 13 // if true, slides wont be resized to fit viewport 14 // requires `itemWidth` to be set 15 // * this may cause fractional slides 16 exactWidth: false, 17 18 // speed aggravator - higher is slower 19 duration: .5, 20 21 // dot container element or selector 22 dots: 'CSS Selector', 23 24 // arrow container elements or selector 25 arrows: { 26 prev: 'CSS Selector', 27 // may also pass element directly 28 next: document.querySelector('CSS Selector') 29 }, 30 31 // allow mouse dragging 32 draggable: false, 33 // how much to scroll with each mouse delta 34 dragVelocity: 3.3, 35 36 // use any custom easing function 37 // compatible with most easing plugins 38 easing: function (x, t, b, c, d) { 39 return c*(t/=d)*t + b; 40 }, 41 42 // event control 43 scrollPropagate: false, 44 eventPropagate: true, 45 46 // Force centering slide after scroll event 47 scrollLock: false, 48 // how long to wait after scroll event before locking 49 // if too low, it might interrupt normal scrolling 50 scrollLockDelay: 150, 51 52 // Force centering slide after resize event 53 resizeLock: true, 54 55 // Glider.js breakpoints are mobile-first 56 responsive: [ 57 { 58 breakpoint: 900, 59 settings: { 60 slidesToShow: 2, 61 slidesToScroll: 2 62 } 63 }, 64 { 65 breakpoint: 575, 66 settings: { 67 slidesToShow: 3, 68 slidesToScroll: 3 69 } 70 } 71 ] 72});
Change options:
1Glider(document.querySelector(element_path)).setOption({ 2 name: value, 3 ... 4}); 5 6// optionally call refresh 7Glider(document.querySelector(element_path)).refresh();
Bind event:
1document.querySelector(element_path).addEventListener('glider-slide-visible', function(event){ 2 // `this` is bound to the glider element 3 // custom data located at `event.detail` 4 // access to Glider object via `Glider(this)` 5 ... 6});
Destroy with:
1Glider(document.querySelector(element_path)).destroy();
Browser support
Glider.js should run on all modern browsers. Support for older browser can be achieved by polyfilling document.classList
, window.requestAnimationFrame
, Object.assign
and CustomEvent
Include glider-compat.min.js
to load the aforementioned polyfills
Native Scrollbars
Most browsers now support the scrollbar-width
property allowing us to avoid the messy hack below.
NOTE: This feature is marked as experimental and may not work in all browsers.
.glider-track {
scrollbar-width: none;
}
Since Glider.js uses native scrolling, the browser wants to apply the standard scrollbar to the glider. In most cases, this is fine since the scrollbar can be hidden with CSS and Glider.js does so when appropriate. In browsers such as Firefox though, the scrollbars cannot be hidden with CSS and require additional markup to hide.
To hide the scrollbars in Firefox, you'll want to wrap your glider with <div class="glider-wrap">
and apply the following CSS/JS:
1@-moz-document url-prefix() { 2 .glider-track { 3 margin-bottom: 17px; 4 } 5 .glider-wrap { 6 overflow: hidden; 7 } 8}
1document.addEventListener('glider-loaded', hideFFScrollBars); 2document.addEventListener('glider-refresh', hideFFScrollBars); 3function hideFFScrollBars(e){ 4 var scrollbarHeight = 17; // Currently 17, may change with updates 5 if(/firefox/i.test(navigator.userAgent)){ 6 // We only need to appy to desktop. Firefox for mobile uses 7 // a different rendering engine (WebKit) 8 if (window.innerWidth > 575){ 9 e.target.parentNode.style.height = (e.target.offsetHeight - scrollbarHeight) + 'px' 10 } 11 } 12}
Packages using Glider.js :rocket:
- react-glider - A react wrapper for Glider.js written in typescript.
Dependencies
None :)
License
Copyright (c) 2018 Nick Piscitelli
Licensed under the MIT license.
It's all yours.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE.txt:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 12 are checked with a SAST tool
Reason
30 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-jc84-3g44-wf2q
- Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q
- Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-gqgv-6jq5-jjj9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-3f95-r44v-8mrg
- Warn: Project is vulnerable to: GHSA-28xr-mwxg-3qc8
- Warn: Project is vulnerable to: GHSA-9p95-fxvg-qgq2
- Warn: Project is vulnerable to: GHSA-9w5j-4mwv-2wj8
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
Score
1.7
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More