mirror of
https://github.com/inventree/inventree-docs.git
synced 2025-06-13 02:35:29 +00:00
Simpler gallery
- use splide.js - iterate though a directory automatically
This commit is contained in:
27
_includes/carousel.html
Normal file
27
_includes/carousel.html
Normal file
@ -0,0 +1,27 @@
|
||||
<div class='splide'>
|
||||
<div class='splide__track'>
|
||||
<ul class='splide__list'>
|
||||
{% for img in listimages(directory) %}
|
||||
{% with src=img %}
|
||||
{% include "splide_image.html" %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener( 'DOMContentLoaded', function () {
|
||||
new Splide(
|
||||
'.splide', {
|
||||
type: 'loop',
|
||||
perPage: 2,
|
||||
autoplay: true,
|
||||
pagination: false,
|
||||
// cover: true,
|
||||
height: '25rem',
|
||||
focus: 'center',
|
||||
}
|
||||
).mount();
|
||||
} );
|
||||
</script>
|
Reference in New Issue
Block a user