Currently engaged in the development of an e-commerce application, where I am looking to accomplish a specific task...
https://i.sstatic.net/sYoG8.png
The objective is to display the corresponding large image on the big box when hovering over smaller images.
The dimensions of the big image are 2000 * 2000 pixels and the small image measures 80 * 80. However, the large images for the small ones are located in a separate folder. The goal is to load the large image into the big box upon hovering over the related small image...
I have attempted some coding but it seems to be malfunctioning...
$('img[id^=sm00]').click(function() {
$('#ProductImage').attr('src', $(this).attr('src'));
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container col-5">
<img src="assets/bank/cart.png" id="ProductImage" class="img-fluid" data-toggle="modal" data-target="#exampleModalCenter" alt="Responsive image">
</div>
<div class="12">
<div class="row">
<img id="sm001" src="assets/bank/bal1.jpg" alt="img1" class="img-thumbnail">
<img id="sm001" src="assets/bank/bal2.jpg" alt="img1" class="img-thumbnail">
<img id="sm002" src="assets/bank/bal3.jpg" alt="img1" class="img-thumbnail">
<img id="sm003" src="assets/bank/bal4.jpg" alt="img1" class="img-thumbnail">
<img id="sm004" src="assets/bank/bal5.jpg" alt="img1" class="img-thumbnail">
</div>
</div>