Here's a fiddle without any help of a plugin: http://jsfiddle.net/SzR6h/25/

Answer to your comment

Assume that your bigger images have a completely different name, I'd put that name in a data-*-Attribute in the image tag, e.g.

<img src="http://0.s3.envato.com/files/19320511/Scenery%2080x80%20Avatar.png"
data-image-big="url_to_image_big"/>

In your javaScript, you can then get image URL by writing:

var urlBigImage = $img.data('image-big');
Answer from iappwebdev on Stack Overflow
๐ŸŒ
Dimsemenov
dimsemenov.com โ€บ plugins โ€บ magnific-popup
Magnific Popup: Responsive jQuery Lightbox Plugin
Three simple popups with different scaling settings. 1 โ€” fits horizontally and vertically, 2 โ€” only horizontally, 3 โ€” no gaps, zoom animation, close icon in top-right corner. You may put any HTML content in each gallery item and mix content types. In this example lazy-loading of images is enabled for the next image based on move direction.
๐ŸŒ
Codehimblog
codehimblog.github.io โ€บ jquery-popup-lightbox
jQuery and CSS Popup Image Lightbox
A simple and clean popup window image lightbox based on css and jQuery.
๐ŸŒ
Noble Desktop
nobledesktop.com โ€บ using a jquery plugin: lightbox (a pop-up image viewer)
Using a jQuery Plugin: Lightbox (A Pop-up Image Viewer) | Free JavaScript Tutorial
June 5, 2025 - Learn how to use a jQuery lightbox plugin called Magnific Popup to improve image display on a webpage, allowing you to create a custom photo gallery with a lightbox effect, navigable with both buttons and keystrokes.
๐ŸŒ
jQuery Script
jqueryscript.net โ€บ tags.php
jQuery image lightbox Plugins | jQuery Script
Magnify is a simple and lightweight jQuery image viewer plugin used to display images in a zoomable, rotatable, draggable, and navigatable lightbox popup.
๐ŸŒ
GitHub
github.com โ€บ permadi-com โ€บ html-jquery-image-popup-lightbox
GitHub - permadi-com/html-jquery-image-popup-lightbox: A simple image popup using JQuery. Will center image vertically and horizontally inside the browser window.
A simple image popup using JQuery. Will center image vertically and horizontally inside the browser window. - permadi-com/html-jquery-image-popup-lightbox
Author ย  permadi-com
๐ŸŒ
jQuery Script
jqueryscript.net โ€บ jquery plugins โ€บ jquery lightbox plugins
Image Modal With Zoom In/Out - jQuery image-popup.js | Free jQuery Plugins
A lightweight and fast jQuery image lightbox plugin that displays images in a modal popup with zoom in and zoom out capabilities.
๐ŸŒ
CodeHim
codehim.com โ€บ home โ€บ lightbox โ€บ onclick image popup jquery lightbox plugin
onclick Image Popup jQuery Lightbox Plugin โ€” CodeHim
January 22, 2024 - A lite plugin / code snippet that helps you to create onclick show image in popup using jQuery. It create HTML & CSS based image popup modal / lightbox.
Find elsewhere
๐ŸŒ
GitHub
github.com โ€บ manharsharma007 โ€บ image-popup-jquery
GitHub - manharsharma007/image-popup-jquery
This jquery plugin can be used to make images popup when clicked. The popup images can be zoomed-in and out used dedicated buttons.
Author ย  manharsharma007
๐ŸŒ
jQuery Mobile
demos.jquerymobile.com โ€บ 1.4.5 โ€บ popup-image-scaling
Popup image scaling - jQuery Mobile Demos
You can prevent vertical scrolling with a simple script that sets the max-height of the image. The handler is bound to the popupbeforeposition event, which ensures the image is not only scaled before it is shown but also when the window is resized (e.g. orientation change).
๐ŸŒ
W3Schools
w3schools.com โ€บ howto โ€บ howto_css_modal_images.asp
How To Create Modal Images
Learn how to create responsive Modal Images with CSS and JavaScript. A modal is a dialog box/popup window that is displayed on top of the current page.
๐ŸŒ
jQuery Mobile
demos.jquerymobile.com โ€บ 1.3.2 โ€บ widgets โ€บ popup โ€บ popup-images.html
jQuery Mobile - Popup images
You can prevent vertical scrolling with a simple script that sets the max-height of the image. In the two examples below the divs with data-role="popup" have a class of photopopup.
๐ŸŒ
Noble Desktop
nobledesktop.com โ€บ jquery lightbox: a pop-up image viewer
jQuery Lightbox: A Pop-up Image Viewer | Free JavaScript & jQuery Tutorial
June 5, 2025 - The tutorial provides an in-depth guide on using JavaScript to create a lightbox effect for enlarging images on a webpage. This involves incorporating a free jQuery lightbox plugin called Magnific Popup.
๐ŸŒ
CodePen
codepen.io โ€บ insidethediv โ€บ pen โ€บ wvJRqOv
Onclick image popup javascript and jQuery
$( document ).ready(function(){ // without animation /* $("#close-btn").click(function(){ $(".small-image").removeClass('active'); $("#show_image_popup").hide(); }) $(".small-image").click(function(){ // add active class $(this).addClass('active'); var image_path = $(this).attr('src'); $("#show_image_popup").hide(); // now st this path to our popup image src $("#show_image_popup").show(); $("#large-image").attr('src',image_path); }) */ // with animation $("#close-btn").click(function(){ // remove active class from all images $(".small-image").removeClass('active'); $("#show_image_popup").slide
๐ŸŒ
jQuery Mobile
demos.jquerymobile.com โ€บ 1.4.5 โ€บ popup
Popup - jQuery Mobile Demos
The text will wrap to multiple lines as needed. A lightbox for displaying images can be created easily by placing an image in a popup. In this example, a close button is added to the markup by adding a link. The data-overlay-theme="b" attribute adds a dark backdrop behind the photos.
Top answer
1 of 1
1

From your question it is not entirely clear what you want to achieve. But since your are mentioning you want to create a pop-up I expect you want to have a dedicated element (div) to showcase your enlarged image.

So in the example below there is an #image-pop-up element that is hidden by default. Since you are already using jQuery, judging by the $('.img-thumbnail') in your example, you can use some of the default jQuery functions to add and remove an image to the #image-pop-up element. And also hide and show it. Adding the image when you click on the thumbnail, and removing it when you click on the enlarged image.

Also do not comma separate your classes in a HTML element!

$(document).ready(function(){
    $('.img-thumbnail').on('click', function() {
        $('#image-pop-up').prepend('<img src=' + $(this).attr('src') + ' id="enlarged-image" />');
        $('#image-pop-up').show();
    });
    
    $('#image-pop-up').on('click', function() {
        $(this).hide();
        $('#enlarged-image').remove();
    });
   
});
#image-pop-up {
  width: 100vw;
  height: 100%;
  box-sizing: border-box;
  padding: 5px;
  position: absolute;
  z-index: 999;
  top: 0;
  left: 0;
  display: none;
}
 
#image-pop-up img {
  width: 100%;
}

figure {
  height: 80px;
  width: auto;
  float: left;
  display: block;
  margin: 0 10px 0 0;
}
 
.img-thumbnail {
  height: 100%;
  border-style: groove;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div id="image-pop-up"></div>

<figure>       
  <img class = "double img-thumbnail" src="https://www.fillmurray.com/400/300" alt="Poodle"             
  title="View larger image..."/>    
  <figcaption class="caption1">Bill 1</figcaption>
</figure>

<figure>       
  <img class = "double img-thumbnail" src="https://www.fillmurray.com/400/500" alt="Poodle"             
  title="View larger image..."/>    
  <figcaption class="caption1">Bill 2</figcaption>
</figure>

<figure>       
  <img class = "double img-thumbnail" src="https://www.fillmurray.com/200/300" alt="Poodle"             
  title="View larger image..."/>    
  <figcaption class="caption1">Bill 3</figcaption>
</figure>

๐ŸŒ
insideTheDiv
insidethediv.com โ€บ onlick-popup-full-size-image-in-jquery
Click on the image to view full size in a popup modal
We know we have an image tag on our popup modal so when we will click on our thumbnail image we will get the value of its src attribute then we will set this value to our modalโ€™s image tag. Getting an imageโ€™s src value in jquery is not like the raw javascript we need to use the attr() method.
๐ŸŒ
Sanwebcorner
sanwebcorner.com โ€บ home โ€บ popup image on click the link โ€บ popup image on click the link using jquery
Popup image on click the link using Jquery
March 28, 2019 - In this example you should add the image to div with the id name is hidden-content that image will display in the popup field. And then you just call the id hidden-content in the <a> tag like below code after included necessary jquery and javascript and css files.