You can use a lightbox to do it.

There is a simple example in this link:

http://lokeshdhakar.com/projects/lightbox2/

Answer from Jack on Stack Overflow
๐ŸŒ
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.
๐ŸŒ
Willmaster
willmaster.com โ€บ library โ€บ features โ€บ image-popup.php
Image Popup
It has one required onclick attribute to call the JavaScript ShowImagePopup function when the image is clicked. The function's parameters are the id values of the div and img tags in the popup container div and also the URL of the popup image โ€” 4 values in all.
๐ŸŒ
Groupthought
help.groupthought.com โ€บ pipeline documentation โ€บ tutorials โ€บ how to show an image in a pop-up window
How to show an image in a pop-up window - Pipeline Documentation
<a class="image-link" href="https://cdn.shopify.com/s/files/1/2018/8867/files/matteo-paganelli-39971_800x.jpg"><img src="https://cdn.shopify.com/s/files/1/2018/8867/files/matteo-paganelli-39971_200x.jpg"></a> ... Pipeline uses Magnific popup. The code you add to shop.js is to initialize the popup based on a link class.
๐ŸŒ
DEV Community
dev.to โ€บ salehmubashar โ€บ create-an-image-modal-with-javascript-2lf3
Create an Image modal with JavaScript! - DEV Community
December 31, 2021 - The basic idea is that when a user clicks an image, a larger version should be opened in a modal. This is commonly seen in lightbox galleries and every other image gallery out there.
๐ŸŒ
YouTube
youtube.com โ€บ watch
Fluid Image Pop Up Javascript Tutorial - YouTube
Check out my courses to become a PRO!https://developedbyed.com/Get some awesome Apparelhttps://teespring.com/stores/developedbyedFluid Image Pop Up Javascrip...
Published ย  June 26, 2020
๐ŸŒ
Bqardi
bqardi.dk โ€บ tutorials โ€บ js โ€บ image-popup โ€บ index.php
Image Popup
Now all there is left is to make sure we can close our popup again We do this with an event listener on the background, so a click anywhere in the viewport makes the popup hide again: popupBackground.addEventListener("click", function(){ popupBackground.style.display = "none"; }) Your code should end up looking something like this: let thumbnails = document.querySelectorAll(".image-popup"); let popupBackground = document.querySelector("#popup-background"); let popupTitle = document.querySelector("#popup-title"); let popupImage = document.querySelector("#popup-image"); thumbnails.forEach(thumbnail => { thumbnail.addEventListener("click", function(){ popupBackground.style.display = "block"; popupTitle.innerHTML = this.alt; popupImage.src = this.src; }) }); popupBackground.addEventListener("click", function(){ popupBackground.style.display = "none"; })
Find elsewhere
๐ŸŒ
CodeWithRandom
codewithrandom.com โ€บ 2024 โ€บ 10 โ€บ 01 โ€บ create-onclick-image-popup-js
How to Create Onclick Image Popup JavaScript - CodeWithRandom
October 1, 2024 - This code is a jQuery script that creates a popup for displaying images when you click on them in a gallery.
๐ŸŒ
CodePen
codepen.io โ€บ Muhnad โ€บ pen โ€บ dMbXNb
image popup
Minimize JavaScript Editor ยท Fold All ยท Unfold All ยท $(function () { "use strict"; $(".popup img").click(function () { var $src = $(this).attr("src"); $(".show").fadeIn(); $(".img-show img").attr("src", $src); }); $("span, .overlay").cli...
๐ŸŒ
HubSpot
community.hubspot.com โ€บ t5 โ€บ Blog-Website-Page-Publishing โ€บ Need-to-create-a-popup-on-click-of-an-image โ€บ m-p โ€บ 808975
Solved: HubSpot Community - Need to create a popup on click of an image - HubSpot Community
July 4, 2023 - I have created a sample header and footer for our revised blog design. I have a requirement for the same. It is to open a popup box on click of a button. It seemed to work from creating a sample page in hubspot. I had created a page added a button and added the popup form using new popup CTA feature.
๐ŸŒ
insideTheDiv
insidethediv.com โ€บ onlick-popup-full-size-image-in-jquery
Click on the image to view full size in a popup modal
To show our popup modal we can use the jquery show() method. But to show popup modal with animation we can use the fadeIn() method. $(".small-image").click(function(){ // $("#show_image_popup").fadeIn(); $("#show_image_popup").show() })
๐ŸŒ
SitePoint
sitepoint.com โ€บ javascript
How to open image in popup window? - JavaScript - SitePoint Forums | Web Development & Design Community
June 30, 2016 - Hi I want to open selected Image on popup window this is I have tried so far there are two things that I am not able to do so far 1)When I click on Image at bottom image in popup window not display on full window.I have to scroll up to see that Image 2)I want to disable click on window when ...
๐ŸŒ
YouTube
youtube.com โ€บ watch
How to open popup on image click? - YouTube
Hey guys, it's Albert in Muffin Group. This is going to be a really short tutorial showing "How to open popup on image click". I've already did several video...
Published ย  October 24, 2023
๐ŸŒ
Dimsemenov
dimsemenov.com โ€บ plugins โ€บ magnific-popup
Magnific Popup: Responsive jQuery Lightbox Plugin
Magnific Popup displays images before they're completely loaded to take full advantage of progressive loading. For in and out transitions CSS3 is used instead of slow JavaScript animation.
๐ŸŒ
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.
๐ŸŒ
MP4Moviez
pakainfo.com โ€บ home โ€บ technology โ€บ how to display image in popup window using javascript or jquery?
How To Display Image In Popup Window Using Javascript Or JQuery? - Pakainfo
Today, We want to share with you how to make a pop up image in html?.In this post we will show you image popup, hear for As Simple As It Gets CSS Popup Image we will give you demo and example for implement.In this post, we will learn about How To Create Modal Images with an example. ... I hope you get an idea about onclick image popup jquery(how to make a pop up image in html?).
๐ŸŒ
YouTube
youtube.com โ€บ insidethediv
Click On The Image To View Full Size In A Popup Modal | onlick popup image - YouTube
#javascript_popup_image #onlick_popup_image #view_full_size_imageClick On The Image To View Full Size In A Popup Modal | onlick popup imageViewing the full-s...
Published ย  June 18, 2021
Views ย  14K
๐ŸŒ
Cloudinary
cloudinary.com โ€บ home โ€บ mastering javascript image popup
Mastering JavaScript Image Popup | Cloudinary
June 23, 2024 - Preload images for smooth popups To avoid delays when images are loaded into a popup, preload the images when the page loads. This ensures that when a user clicks on an image, it appears instantly.
๐ŸŒ
Unc
opal.ils.unc.edu โ€บ ~lblakej โ€บ website-helps โ€บ 04-image-popup
Image Popup Example
Be careful not to click on the image as that will trigger the popup. Right click anywhere above the image. This will only work on a single image. To do a gallery, you should find a more robust javascript source such as Magnific Popup.