Kagri
02-06-2010, 08:02 PM
Hello everybody!
I tried to modify Image Thumbnail Viewer II (http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm) (which, by the way, has stopped working for me on DD page when I use IE), to have image tittle popping up on mouseover (instead of just being written under the image). I use TITLE attribute for this.
But! I doesn't seem to work. The image changes, but TITLE is only seen for the image loaded by default, NOT for the image replacing it. I'm really lost at what goes wrong, so I was wondering if somebody could help me modify it in a correct way?
Here's the altered part of the code:
var imageHTML='<img src="'+imagepath+'" alt="" title="'+description+'" />' //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+='<span class="credits"><br />'+description+'</span>'
As you can see, I have commented out the part that was responsible for showing the image's description as a line below the image. And I have copied '+description+' into the <IMG> tag. It all seems correct, but why won't it work? Here's the link to the page where it goes wrong: http://mlp.imagesofher.com/pony.php?ID=7&variant=21
By the way, the original code (that was supposed to show title below the image) won't work for me, either! So I really don't know how to fix this...
Thank you VERY VERY much for your help. :)
I tried to modify Image Thumbnail Viewer II (http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm) (which, by the way, has stopped working for me on DD page when I use IE), to have image tittle popping up on mouseover (instead of just being written under the image). I use TITLE attribute for this.
But! I doesn't seem to work. The image changes, but TITLE is only seen for the image loaded by default, NOT for the image replacing it. I'm really lost at what goes wrong, so I was wondering if somebody could help me modify it in a correct way?
Here's the altered part of the code:
var imageHTML='<img src="'+imagepath+'" alt="" title="'+description+'" />' //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+='<span class="credits"><br />'+description+'</span>'
As you can see, I have commented out the part that was responsible for showing the image's description as a line below the image. And I have copied '+description+' into the <IMG> tag. It all seems correct, but why won't it work? Here's the link to the page where it goes wrong: http://mlp.imagesofher.com/pony.php?ID=7&variant=21
By the way, the original code (that was supposed to show title below the image) won't work for me, either! So I really don't know how to fix this...
Thank you VERY VERY much for your help. :)