-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathenable-thumbnail-carousel.js
More file actions
48 lines (42 loc) · 1.24 KB
/
Copy pathenable-thumbnail-carousel.js
File metadata and controls
48 lines (42 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'use strict'
/*******************************************************************************
* enable-thumbnail-carousel.js - Accessible shim over the Glider carousel
*
* Written by Zoltan Hawryluk <zoltan.dulac@gmail.com>
* Part of the Enable accessible component library.
* Version 1.0 released December 27, 2021
*
* More information about this script available at:
* https://www.useragentman.com/enable/carousel.php
*
* Released under the MIT License.
******************************************************************************/
import '../../enable-node-libs/@splidejs/splide/dist/js/splide.min.js';
const EnableThumbnailCarousel = function () {
const defaultOptions = {
pagination: false,
}
const main = new Splide('#main-carousel', {
...defaultOptions,
type: 'fade',
arrows: false,
lazyLoading: 'sequential',
});
const thumbnails = new Splide('#thumbnail-carousel', {
...defaultOptions,
fixedWidth: 150,
gap: 10,
isNavigation: true,
focus: 'center',
breakpoints: {
'768': {
fixedWidth: 125,
}
}
});
// sync the thumbnails slider as a target of main slider.
main.sync(thumbnails);
main.mount();
thumbnails.mount()
}
export default EnableThumbnailCarousel;