content logo

Bootstrap Thumbnails:

Change Image on Hover with Bootstrap

As we all know, thumbnails are the small preview images that designers and photographers use to represent a larger file with a bigger size. This makes it so much easier to manage a number of pictures especially since you don’t have to memorize the name of each file. Websites such as e-commerce sites, online stores, and many other types of websites that employ visual catalogues are usually a big fan of these thumbnail gallery phots. Besides, thumbnail images are much smaller in size which has two main benefits. First of all, when you are loading the page, only the thumbnails load which does not require as much bandwidth and speeds up the loading process by a huge amount. Secondly, it gives the user some kind of control as they are able to choose which image they want to see in a larger format. Fortunately for you, making a thumbnail gallery with Bootstrap is an easy task.

In this post, we are sharing a Bootstrap beautiful thumbnail with a special style. The code features some normal looking images similar to a Bootstrap thumbnail collection in a gallery but in fact they are thumbnails with change image hover effect. Whenever you hover your mouse cursor over an image, the thumbnail changes and shows another. A short custom text is also displayed below each image which could be used as a subject.

#

Bootstrap Thumbnail Collection

#

Bootstrap Beautiful Thumbnail

#

Thumbnail with Change Image

#

Thumbnail Gallery with Bootstrap

#

Thumbnail Gallery Photos

<!-- This script got from frontendfreecode.com -->
<div class="container">
    <div class="row">
        <div class="col-md-4 col-xs-4">
            <div class="thumbnail">
                <div class="picture1">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/pizza.jpeg" alt="...">
                </div>
                <div class="picture2">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/salad-square.jpg" alt="">
                </div>
                <div class="caption">
                    <h3>Thumbnail label</h3>
                </div>
            </div>
        </div>
        <div class="col-md-4 col-xs-4">
            <div class="thumbnail">
                <div class="picture1">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/pizza.jpeg" alt="...">
                </div>
                <div class="picture2">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/salad-square.jpg" alt="">
                </div>
                <div class="caption">
                    <h3>Thumbnail label</h3>
                </div>
            </div>
        </div>
        <div class="col-md-4 col-xs-4">
            <div class="thumbnail">
                <div class="picture1">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/pizza.jpeg" alt="...">
                </div>
                <div class="picture2">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/salad-square.jpg" alt="">
                </div>
                <div class="caption">
                    <h3>Thumbnail label</h3>
                </div>
            </div>
        </div>
    </div>
</div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
.picture2 {
    display: none;
}
.thumbnail:hover .picture1 {
    display: none;
}
.thumbnail:hover .picture2 {
    display: block;
}
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js'></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js'></script>
<style>
.picture2 {
    display: none;
}
.thumbnail:hover .picture1 {
    display: none;
}
.thumbnail:hover .picture2 {
    display: block;
}
</style>

</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-4 col-xs-4">
            <div class="thumbnail">
                <div class="picture1">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/pizza.jpeg" alt="...">
                </div>
                <div class="picture2">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/salad-square.jpg" alt="">
                </div>
                <div class="caption">
                    <h3>Thumbnail label</h3>
                </div>
            </div>
        </div>
        <div class="col-md-4 col-xs-4">
            <div class="thumbnail">
                <div class="picture1">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/pizza.jpeg" alt="...">
                </div>
                <div class="picture2">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/salad-square.jpg" alt="">
                </div>
                <div class="caption">
                    <h3>Thumbnail label</h3>
                </div>
            </div>
        </div>
        <div class="col-md-4 col-xs-4">
            <div class="thumbnail">
                <div class="picture1">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/pizza.jpeg" alt="...">
                </div>
                <div class="picture2">
                    <img class="img-responsive" src="http://frontendfreecode.com/img/salad-square.jpg" alt="">
                </div>
                <div class="caption">
                    <h3>Thumbnail label</h3>
                </div>
            </div>
        </div>
    </div>
</div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>

</body>
</html>
Preview