OK, replace this line in the script:
Code:
crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Close</span> </div><img src="'+which+'">'
with these lines:
Code:
var innerString='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Close</span> </div><center id="desc"><img src="'+which+'">'
if (desc!==undefined){
if (desc!=='')
innerString+='<br>'+desc
}
innerString+='</center>'
crossobj.innerHTML=innerString
Add this to the style section:
Code:
#desc {
background-color: #EFEFEF;
font-size:80%;
}
Now, use the description like so:
Code:
<a href="photo1.jpg" onClick="return enlarge('photo1.jpg',event,'Kissing Fools')">
<img src="thumb1.jpg" border="0"></a>
in the HTML markup. If you are using no description, still include the empty (don't even put a space in there) pair of single quotes behind:
Code:
<a href="photo2.jpg" onClick="return enlarge('photo2.jpg',event,'')">
<img src="thumb2.jpg" border="0"></a>
This isn't necessary here but, if you use any of the other parameters it will be like with:
onClick="return enlarge('myimage.gif',event, 'description', 'center', imagewidth, imageheight)"
Also, don't go overboard with these descriptions. If they are too long, it will look weird. If you really must use a description that is longer than your image is wide, either live with the extra space displayed in the pop-up or use <br>'s to break up the description.
Bookmarks