PDA

View Full Version : Ult fade in slideshow:any way to add alt/title tags to images?



avdistribution
08-24-2010, 04:54 PM
1) Script Title: Ultimate Fade-in slideshow (v2.4)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem:
Im sure asked before but search didn't find a thread. Any way to add alt/title tags to images?

azoomer
08-25-2010, 09:33 AM
HI avdistribution. I'm not entirely sure if it is the right way to do it, but here's how I did it.
In the fadeslideshow.js around line 217, I added the blue stuff:

fadeSlideShow.routines={

getSlideHTML:function(imgelement){
var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+'" alt="'+imgelement[4]+'" title="'+imgelement[5]+'">\n' : '' //hyperlink, alt and title?
layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0;" />\n'
layerHTML+=(imgelement[1])? '</a>\n' : ''
return layerHTML //return HTML for this layer
},
and then the image arrays where written like this

["images/1.jpg", "http://dynamicdrive.com/forums", "_new", "this is a description of image 1", "this is the alt text for image 1", "this is the title of image 1"],
["images/2.jpg", "http://dynamicdrive.com/forums", "_new", "this is a description of image 2", "this is the alt text for image 2", "this is the title of image 2"],
["images/3.jpg", "http://dynamicdrive.com/forums", "_new", "this is a description of image 3", "this is the alt text for image 3", "this is the title of image 3"]
The title can be seen when you hover over the image. The alt text can be seen if you save the page f.ex to the desktop and then view the source of the saved page.
Tell me if it works for you

avdistribution
08-25-2010, 04:16 PM
Thanks for the response. I think I added it right but still no tags on this page (http://webbrewers.com/default.aspx)
Here's the fadeslideshowfile (http://webbrewers.com/Documents/fadeslideshow.js)and here's the array file (http://webbrewers.com/Documents/fadeslideshowintro.js).

azoomer
08-25-2010, 07:25 PM
Hi, this is my page (http://azoomer.com/UFIS/ufis_w_alt.html) and this is the fadeslideshow.js (http://azoomer.com/UFIS/fadeslideshow-w-alt.js) that is used. The alt and title tags are in the DOM and can't be seen directly when viewing the source, but if you download the entire page and then open it in a text editor you will see it.
In the fadeslideshowfile on your server I cant find this line when I make a search for some of the elements
var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+'" alt="'+imgelement[4]+'" title="'+imgelement[5]+'">\n' : ''
But it seems like the script is minified somehow which makes it difficult for me to understand.

avdistribution
09-03-2010, 10:30 PM
My bad-the tags weren't showing up on a full screen size slide show-but on a smaller one they do. So obviously it works, which is much appreciated.
The scripts are directly from dd with few adjustments so don't know why they appear minified.