Welcome to phpLightBox, click the thumbnail below to see the 100% javascript free php lightbox in action!



This PHP script does not required any Javascript at all, it is simply some xhtml, css, and then a PHP script to generate it all.

This PHP Lightbox was not really created as a replacement or an alternative to the very popular and very good JS Lightbox at: http://www.lokeshdhakar.com/projects/lightbox2/ [opens new window] or any of the many other versions out there. It was really just a test, or a challenge you could say to see if it was possible to create a Javascript free Lightbox and, well here you go!

I must admit its not flashy like the JS version but it looks good and performs very well I must say. One of the other things about this version is that it requires you to go to a new page, or more like a page refresh to make the large image appear and also the same to exit the lightbox too. This can be a problem or annoying if you was on quite a long page and you clicked on a image near the bottom of the page to see a large version, the page would basically refresh and show the large version but then you are put back up at the top of the page and would need to scroll back down again to get back to where you were, you see a problem, this could be annoying!

Well I think since I have enjoyed getting this far with the php version of the lightbox script I will keep on going to see if there is any way of making it more flashy, and also see if I can figure out a way around this loosing your position on the page due to the page refresh.

Heres another image you can take a look at using this script, you will notice that the link opens up lightbox=2, there are 5 images in total linked to the lighbox script on this page, even though you can only see two, basically for each page all of the images that you want to use the script sit in an array, these can be generated dynamically or you can manually write them and so with how arrays work when lightbox=2 is loaded you will see that you are at image three out of five in the total array of images available and also you can navigate through the rest just like the Javascript version, good ay!


Visit again soon to see if I have made any progress, and thanks for reading!

Content © Martin Wilkins 2008
Long Eaton Nottingham East Midlands UK