Image Gallery Guide
This guide demonstrates how to use image galleries in the documentation.
Basic Gallery
To create a simple image gallery, add multiple images with the same data-gallery attribute:
{.glightbox data-gallery="group1"}
{.glightbox data-gallery="group1"}
{.glightbox data-gallery="group1"}
{.glightbox data-gallery="group1"}
Which renders as:
Multiple Galleries
You can have multiple galleries on the same page by using different data-gallery values:
Gallery A
Gallery B
Gallery with Different Image Sizes
The gallery adapts to different image sizes while maintaining a clean layout:
Using with Documentation Screenshots
Galleries are perfect for showing interface screenshots or step-by-step processes:
Technical Details
The gallery functionality is powered by GLightbox, a pure JavaScript lightbox library with mobile support.
Features
- Responsive design
- Mobile-friendly touch navigation
- Keyboard navigation
- Fullscreen mode
- Zoom capability
- Caption support
Implementation Notes
The gallery script automatically:
- Groups images with the same
data-galleryattribute - Creates a responsive grid layout for each group
- Handles captions using the image's title attribute
- Opens a lightbox gallery when an image is clicked
Video Support
GLightbox also supports embedding videos. For example:
For more details, see the GLightbox documentation.
Created: June 10, 2025 04:12:20
Last update: June 10, 2025 04:12:20