A lightweight and responsive JavaScript image and videos(youtube, vimeo and mp4) gallery library.
Publicidade BH - Apps, Sistemas e sites - https://www.publicidadebh.com.br/
https://github.com/leandrolopes13/jgallery-wp
- πΌοΈ Responsive image gallery
- π Lightweight and fast
- π¨ Customizable styling
- π± Mobile-friendly
- π Image zoom support
- β¨οΈ Keyboard navigation
- π― Easy to integrate
npm install jgallery<!-- Include the CSS -->
<link rel="stylesheet" href="jgallery.min.css">
<!-- Create your gallery container -->
<div class="gallery">
<a href="example/image1.jpg" class="jgallery-item" data-type="image">
<img src="example/image1.jpg">
</a>
<a href="example/image2.jpg" class="jgallery-item" data-type="image">
<img src="example/image2.jpg">
</a>
<a href="#" class="jgallery-item" data-type="video">
<video poster="example/poster.jpg">
<source src="example/video1.mp4" type="video/mp4">
</video>
</a>
<a href="https://vimeo.com/76979871" class="jgallery-item" data-type="video">
<img src="https://i.vimeocdn.com/video/452001751-8216e0571c251a09d7a8387550942d89f7f86f6398f8ed886e639b0dd50d3c90-d_260x163">
</a>
<a href="https://www.youtube.com/watch?v=4FUnXaq_VWk" class="jgallery-item" data-type="video">
<img src="https://i3.ytimg.com/vi/4FUnXaq_VWk/hqdefault.jpg">
</a>
</div>
<!-- Include the JavaScript -->
<script src="jgallery.min.js"></script>
<script>
// Initialize the gallery
$('.gallery a').jgallery({
zoom: true
});
</script>$('.gallery a').jgallery({
zoom: true
});Enable zoom function. (Default: true)
$('.gallery a').jgallery({
zoom: true
});is fired when the content dimensions are recalculated
.on('jgallery.resize', function (e) {
console.log('jgallery.resize');
})is fired when the open the lightbox
.on('jgallery.open', function (e) {
console.log('jgallery.open');
})is fired when the content is changed
.on('jgallery.change', function (e) {
console.log('jgallery.change');
})is fired when the content is fully loaded
.on('jgallery.loaded', function (e) {
console.log('jgallery.loaded');
})is fired when the lightbox is closed
.on('jgallery.close', function (e) {
console.log('jgallery.close');
})- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Opera (latest)
This project is licensed under the MIT License - see the LICENSE file for details.
Leandro Lopes - leandrolopes.java@gmail.com - GitHub Profile
- Thanks to all contributors who have helped make jGallery better
- Inspired by various gallery libraries in the JavaScript ecosystem