Jump to content
Sign in to follow this  

JS image

Recommended Posts

I need this code to not open the image in a new window, but rather to display the image on the same page?


<style>.elementor-gallery-title{cursor: pointer;} </style>

'use strict';
document.addEventListener('DOMContentLoaded', function () {

var filteredImages = document.querySelectorAll('.elementor-gallery-title');

//Edit the links HERE
var links = [

var _loope = function _loope(i) {
filteredImages.addEventListener('click', function () {
location = links;

for (var i = 0; i < filteredImages.length; i++) {



Share this post

Link to post
Share on other sites

You can use popup for that :

with jQuery:



$(document).ready(function() {


<a class="image-link" href="your-image-url">Open popup</a>pl

 Or you can also use boostrap model for that.

Here is the example:https://www.w3schools.com/howto/howto_css_modal_images.as

Edited by ishan_shah

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...