Results 1 to 4 of 4

Thread: Add alt to New Fade Slideshow

  1. #1
    Join Date
    Sep 2016
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Add alt to New Fade Slideshow

    1) Script Title: Ultimate New Fade Slideshow v. 2.0

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem: To meet ADA (Americans with Disabilities Act) requirements, I need to add "alt" references for each image. Is there a way to do this in the Ultimate Fade Slideshow script?

    Thank you for your assistance.

  2. #2
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    488
    Thanks
    0
    Thanked 62 Times in 58 Posts

    Default

    Look in the fadeslideshow.js file and around line 300 you will find this code:

    Code:
    	getSlideHTML:function(imgelement){
    		var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+'">\n' : '' //hyperlink slide?
    		layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0;" />\n'
    		layerHTML+=(imgelement[1])? '</a>\n' : ''
    		return layerHTML //return HTML for this layer
    	},
    change it to this:

    Code:
    	getSlideHTML:function(imgelement){
    		var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+'">\n' : '' //hyperlink slide?
    		layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0;"'
    		layerHTML+=(imgelement[4])? ' alt="'+imgelement[4]+'"' : ''
    		layerHTML+=' />\n'
    		layerHTML+=(imgelement[1])? '</a>\n' : ''
    		return layerHTML //return HTML for this layer
    	},
    Then add a fifth element containing the 'alt' text to all your slide descriptions like this:

    Code:
    <script type="text/javascript">
    
    var mygallery=new fadeSlideShow({
    	wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
    	dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of largest image
    	imagearray: [
    		["http://www.dynamicdrive.com/dynamicindex4/pool.jpg","","","","alt text is here"],
    		["http://www.dynamicdrive.com/dynamicindex4/cave.jpg","","","","alt text is here"],
    		["http://www.dynamicdrive.com/dynamicindex4/fruits.jpg","","","","alt text is here"],
    		["http://www.dynamicdrive.com/dynamicindex4/dog.jpg","","","","alt text is here"] //<--no trailing comma after very last image element!
    	],
    	displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
    	persist: false, //remember last viewed slide and recall within same session?
    	fadeduration: 500, //transition duration (milliseconds)
    	descreveal: "always",
    	togglerid: ""
    })
    Incidentally, you can also add 'title' text using the same method.
    Last edited by styxlawyer; 12-17-2016 at 01:09 PM.

  3. The Following User Says Thank You to styxlawyer For This Useful Post:

    skitog (12-18-2016)

  4. #3
    Join Date
    Sep 2016
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much for your quick response. You solved my problem and now I am able to add the "alt" text. Your help is much appreciated!

  5. #4
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    488
    Thanks
    0
    Thanked 62 Times in 58 Posts

    Default

    You're welcome.

Similar Threads

  1. Remove initial fade in from Ultimate Fade-in slideshow
    By optimus203 in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 05-14-2012, 06:37 PM
  2. Ultimate Fade-in slideshow (v2.4) - fade description text
    By kwakker35 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 02-06-2012, 04:13 PM
  3. Replies: 3
    Last Post: 07-12-2010, 04:04 PM
  4. Ultimate Fade-in slideshow in Safari doesn't fade
    By dab in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 02-15-2007, 01:30 PM
  5. Change fade time in Ultimate Fade In slideshow
    By Zaphodz in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 11-17-2006, 01:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •