Actually, it was this function that did the 'heavy lifting' for the pop up:
Code:
function popuplinkfunc(imgsrc){
if (popupsetting[0]==1){
var desc='';
for (var i = galleryarray.length-1, lookup = imgsrc.href.replace(targetlinkdir,'') ; i > -1 ; --i)
if(galleryarray[i][0]==lookup)
desc=galleryarray[i][1];
var popwin=open('', "popwin", popupsetting[1]);
popwin.document.write('<title>'+desc+
'<\/title><body style="margin:0;padding:0;font:85% sans-serif;text-align:'+
'center;overflow:auto;background-color:#0d576d;color:white;"><img title="'+
desc+'" alt="Larger Image" style="margin:2px 0;" src="'+imgsrc.href+'"><br>'+desc);
popwin.document.close();
popwin.focus();
return false;
}
else
return true;
}
It did rely upon:
Code:
var popupsetting=[1, "width=669px, height=691px, scrollbars, resizable"]
and the array of images for settings and data respectively, as well as upon the location of the image as handed to it by the rest of the script when a thumbnail was clicked on.
What we could do is alter it slightly so that it is more independent and relies solely upon the a tag and the thumbnail's alt attribute for its data:
Code:
function popuplinkfunc(imgsrc){
var desc=imgsrc.getElementsByTagName('img')[0].alt;
var popwin=open('', 'popwin', 'width=669, height=691, scrollbars, resizable');
popwin.document.write('<title>'+desc+
'<\/title><body style="margin:0;padding:0;font:85% sans-serif;text-align:'+
'center;overflow:auto;background-color:#0d576d;color:white;"><img title="'+
desc+'" alt="Larger Image" style="margin:2px 0;" src="'+imgsrc.href+'"><br>'+desc);
popwin.document.close();
popwin.focus();
return false;
}
Now it can stand completely on its own and be called directly from your link:
Code:
<a onclick="return popuplinkfunc(this);"
href="/img/<?=$lcArtist;?>/lg/<?=$title['filetag']?>.jpg">
Bookmarks