Bizon.js is a lightweight JavaScript library for displaying image galleries in a modern, responsive popup. This README provides installation instructions, usage examples, and customization options.
- 📷 Image gallery in a popup
- 🎨 Customizable styles and captions
- 🔄 Lightweight and fast
- 🖼️ Supports thumbnails
- 🔧 Easy integration
- Download the latest version of
bizon2.jsandbizon2.css. - Place them in your project folder.
<link rel="stylesheet" href="https://cdn.example.com/bizon2.css">
<script src="https://cdn.example.com/bizon2.js"></script>Create a simple HTML page and integrate Bizon.js:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bizon.js v2.0 Demo</title>
<link rel="stylesheet" href="bizon2.css">
</head>
<body>
<h1>Bizon v2.0Alpha</h1>
<h2>Display gallery in a popup</h2>
<button id="openGallery">Open Gallery</button>
<script src="bizon2.js"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
const sampleImages = Array.from({ length: 10 }, (_, i) => ({
src: `images/sample_${i + 1}.jpeg`,
thumb: `images/sample_${i + 1}_thumb.jpeg`,
caption: `Sample Image ${i + 1}`
}));
const gallery = new BizonGallery({
title: "Sample Gallery",
images: sampleImages,
callbacks: {
onClose: () => console.log("Gallery closed")
}
});
document.getElementById("openGallery").addEventListener("click", () => {
gallery.show();
});
});
</script>
</body>
</html>Creates a new instance of BizonGallery.
| Property | Type | Description |
|---|---|---|
title |
string |
The title of the gallery. |
images |
Array |
Array of image objects with src, thumb, and caption. |
callbacks |
Object |
Optional event listeners such as onClose. |
Opens the image gallery.
Closes the gallery.
You can customize the gallery's appearance by modifying bizon2.css.
const gallery = new BizonGallery({
images: [...],
callbacks: {
onClose: () => alert("Gallery closed")
}
});MIT License.
Contributions are welcome! Please submit issues and pull requests on GitHub.