Demo 4: Integrating Thumbnail Slider as a Lightbox

In this demo, clicking a gallery image launches the thumbnail slider in lightbox mode, allowing users to browse larger versions of the images seamlessly.

HTML

<div id="thumbnail-slider" style="display:none;">
    <div class="inner">
        (...ommitted for brevity)
    </div>
    <div id="closeBtn">CLOSE</div>
</div>
<ul id="myGallery">
    <li><img src="img/1.jpg" /></li>
    ......
    <li><img src="img/9.jpg" /></li>
</ul>

The Thumbnail Slider Lightbox and the image gallery can use different images, or as this demo did, use the same images.

JavaScript

Styles

Please refer to the source code included in the download package.