I’ve got an image of a map on a general FAQ page (not a product image etc).
I need the user to be able to click on the image to see it full size in a pop-up that can then be closed to go back to the page.
A user needed to make a map image on their Shopify FAQ page clickable to display at full size in a popup overlay.
Solutions Provided:
Two community members offered similar HTML/CSS/JavaScript implementations:
Key Technical Elements:
{{ 'filename.jpg' | asset_url }}Resolution:
The original poster confirmed the solution worked perfectly after setting up an HTML section in their theme editor. No apps or external libraries required—just basic HTML, CSS, and JavaScript embedded directly in the page.
I’ve got an image of a map on a general FAQ page (not a product image etc).
I need the user to be able to click on the image to see it full size in a pop-up that can then be closed to go back to the page.
Upload the full size image to your Shopify files:
Go to Settings Files, upload your image, and copy the URL.
Add this code to your FAQ page or custom HTML block where you want the image to appear:
html
Copy
Edit
– Thumbnail Image
img src=“https://your-cdn-link.com/map-thumb.jpg” alt=“Map” id=“mapImage” style cursor: pointer; max-width: 100%;
Popup Container
<span style=“position: absolute; top: 20px; right: 30px; font-size: 40px; color: white; cursor: pointer;” id="closeModal"× span
JavaScript
Replace both image URLs with the correct links to your thumbnail and full-size map image from your Shopify Files.
What this does:
When the user clicks the map, a full-size version pops up in the center of the screen.
A close (×) button lets them exit the popup and return to the page—no page reload needed.
How to Create a Clickable Image Lightbox on Your Shopify FAQ Page
To make an image on your FAQ page (such as a map) open in a larger popup when clicked, you can implement a straightforward solution using HTML and JavaScript directly within the Shopify page editor. Here’s how:
Step 1: Insert the HTML Structure
Navigate to your FAQ page in the Shopify admin and locate the section where you want to embed the clickable image. Within the editor, use the “Show HTML” button (<>) to insert the following code:
HTML
<div style="text-align: center;">
<img src="{{ 'your-image.jpg' | asset_url }}" alt="Map" style="max-width: 300px; cursor: pointer;" onclick="openLightbox(this.src)">
</div>
<div id="lightbox" style="display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); justify-content:center; align-items:center; z-index:9999;" onclick="closeLightbox()">
<img id="lightbox-img" src="" style="max-width:90%; max-height:90%;">
</div>
Important:
Step 2: Add the JavaScript Code
Immediately after the HTML code you inserted in Step 1 (still within the “Show HTML” view), add the following JavaScript code:
HTML
<script> function openLightbox(src) {
document.getElementById("lightbox-img").src=src;
document.getElementById("lightbox").style.display = "flex";
}
function closeLightbox() {
document.getElementById("lightbox").style.display = "none";
}</script>
Explanation:
How it Works:
This setup utilizes basic HTML for the image and the lightbox container, inline CSS for minimal styling, and JavaScript to handle the interactivity of opening and closing the lightbox. When a user clicks the image, the openLightbox function is called, making the hidden lightbox visible and displaying the clicked image within it. Clicking anywhere on the darkened background then calls the closeLightbox function, hiding the lightbox again.
This method provides a simple and effective image lightbox solution without relying on external apps or complex libraries.
Thanks Dc221.
It worked perfectly once I set up HTML section to use.
Then did i deserve like