Jump to content

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++) {



Link to comment
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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...