Convert to lightbox?

I am trying to replicate,
so the same effect can be achieved (click on the thumbnail to switch the larger image on the left) but I want to change what happens when the larger image is clicked (instead of it going directly to the image, it will open up a lightbox image thing to create a pop-up type look) I wasn’t sure which forum to ask this, but my guess is PHP is involved to do this (so if its easier we can do away with the javascript that currently there

This has to be done with JS though some stuffs needed to be constructed with PHP too. See this jQuery plugin hope you can manage:

You need to do a trick for grabbing dynamically clicked thumbnail image source.

Is there a way to just PHP for everything?
(dont use javascript for anything"?)

You can use PHP for everything, but it requires reloading the page on every click.

That is how things should be developed anyway, only after which you should use javascript to enhance the user experience.

Generally NOPE. It is not possible to do any types of light box without JS though it can be possible by reloading the page in each click as Paul said. But I don’t think that is what you are looking for. Please be known to the fact that if you want to make the pages more user friendly and interactive then you must go for JS. BTW, what is the problem to use JS for that?

I thought Id need PHP to load all images, but how can I make lightbox work on each image using JS?

By following this link - lightbox

Unless I’m misunderstanding. Lightbox is all JavaScript and there is no PHP involved. All you need to do is link to the .js and .css files from the <head> then add rel=“lightbox” to any link:

<a href="#" rel="lightbox" title="This is a caption for the image pop up"><img src="#" width="200" height="200" alt="This is an alternate text version of the image" /></a>

Hope it helps. :slight_smile:

As OP has asked replicate of so there is little different than the normal integration of light box does. First click on the thumbnail and show the large image of that clicked image in light box. So it needs some different own code afaik.

I have already worked for the same but need to separate it from a long jQuery script. Will post later if still it is not solved yet.