12-23-2009, 01:30 AM
|
#3 (permalink)
|
|
The Addict
Join Date: May 2009
Posts: 287
Thanks: 5
|
Just a site note: If you want to do this client side than something like this should work.
The advantage to using JavaScript is that you will save some processing time. It will still work because jQuery checks the element when it's clicked, so unless the user instantly clicks the image it (the page) may "load faster".
The downside is that older browsers will take a long time to process through a lot of image elements (10-15+).
javascript Code:
function set_lightboxes() { var image_elements = document.getElementsByTagName('img'); var n, count = image_elements.length;
for (n = 0; n < count; n++) { image_elements[n].rel = 'lightbox'; } return; }
window.onload = function () { set_lightboxes(); }
|
|
|
|