A lightweight, responsive image gallery with a "See More" feature. This gallery automatically handles image overflow by displaying a counter for additional images.
- Responsive grid layout
- Configurable maximum image display
- "See More" counter for overflow images
- Smooth image loading
- Mobile-friendly design
- No external dependencies
The gallery displays images in a 3x2 grid with:
- Maximum configurable visible images
- Automatic "See More" counter
- Consistent image sizing
- Shadow effects
- Rounded corners
- Include the HTML structure:
<div class="container">
<div class="custom_gallery" data-max-images="6">
<img src="/path/to/image1.jpg" class="custom_gallery_item">
<img src="/path/to/image2.jpg" class="custom_gallery_item">
<!-- Add more images as needed -->
</div>
</div>
- Set the maximum images attribute:
data-max-images="6" <!-- Adjust this number as needed -->
.container
: Main wrapper for centering.custom_gallery
: Gallery grid container.custom_gallery_item
: Individual image items.extra-element
: "See More" counter element
.container /* Main container */
.custom_gallery /* Gallery grid */
.custom_gallery_item /* Image items */
.extra-element /* See more counter */
- Automatic image counting
- Dynamic "See More" counter
- Configurable maximum images
- Responsive grid layout
.custom_gallery {
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 200px 200px;
gap: 10px;
}
.custom_gallery_item {
width: 200px;
height: 200px;
object-fit: cover;
border-radius: 5px;
}
The gallery is fully responsive and works across all device sizes:
- Desktop: 3x2 grid
- Tablet & Mobile: Responsive layout
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License.
Rabha
- GitHub: @codewithrabha
- Ensure all images are of similar dimensions for best results
- Optimize images for web use
- Use appropriate image formats (JPG, PNG, WebP)
- Adjust
data-max-images
based on your needs
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Opera (latest)