1
0
mirror of https://github.com/oupala/apaxy.git synced 2025-08-09 22:06:28 +02:00

feat: add lightgallery as lightbox gallery

This commit is based on issue #89.
This commit is contained in:
oupala
2019-05-28 15:36:38 +02:00
parent bf175eab74
commit cc364861f0

View File

@@ -1,3 +1,29 @@
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.3.9/css/lightgallery.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.3.9/js/lightgallery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var imageSelector = [
'.indexcolname a:contains(".jpg"):not(:contains(".json"))',
'.indexcolname a:contains(".jpeg"):not(:contains(".json"))',
'.indexcolname a:contains(".png"):not(:contains(".json"))',
].join(', ');
var $table = $('table'),
$images = $table.find(imageSelector);
if ($table.length && $images.length) {
$table.lightGallery({
selector: imageSelector,
mode: 'lg-fade',
download: true
});
}
});
</script>
<div class="wrapper">
<!-- we open the `wrapper` element here, but close it in the `footer.html` file -->