PDA

View Full Version : Image Thumbnail Viewer II



amysrabbitranch
05-18-2008, 04:38 PM
1) Script Title: Image Thumbnail Viewer II

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm

3) Describe problem: Not a problem really - just an edit and I suck as js. I want the "title" text, which is being used as a description, to show above the image, not below like how it is scripted. I think this is the section I need to look at:

loadimage:function(linkobj){
var imagepath=linkobj.getAttribute("href") //Get URL to enlarged image
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0]) //Reference container on page to show enlarged image in
var dest=linkobj.getAttribute("rev").split("::")[1] //Get URL enlarged image should be linked to, if any
var description=(thumbnailviewer2.enableTitle && linkobj.getAttribute("title"))? linkobj.getAttribute("title") : "" //Get title attr
var imageHTML='<img src="'+imagepath+'" style="border-width: 0" />' //Construct HTML for enlarged image
if (typeof dest!="undefined") //Hyperlink the enlarged image?
imageHTML='<a href="'+dest+'">'+imageHTML+'</a>'
if (description!="") //Use title attr of the link as description?
imageHTML+='<br />'+description
if (this.iefiltercapable){ //Is this an IE browser that supports filters?
showcontainer.style.filter=this.iefilterstring
showcontainer.filters[0].Apply()
}
I have done no editing to the original js file - I tried fumbling around in it to change it to the top to no avail. I really don't know what I'm looking at with this one.
The original js file is this: http://www.dynamicdrive.com/dynamicindex4/thumbnailviewer2.js

amysrabbitranch
05-18-2008, 05:19 PM
Nevermind! Got it! :D

the line

imageHTML+='<br />'+description
I changed to:

imageHTML=description+'<br /><br />'+imageHTML

:D

And I got the silly mouseover ("alt text") text gone by editing my csscript.js file :D