View Full Version : Newline does not work in Ultimate Fade-in slideshow

02-28-2012, 06:51 PM
1) Script Title: Ultimate Fade-in slideshow

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

3) Describe problem: I have been experimenting with the slideshow script over the past few days. One problem I have is that if \n (newline) is included in the description it is ignored - text is displayed in a single string which wraps if too long for a single line. I would like to be able to define where the new lines occur.

Any help would be appreciated.



02-29-2012, 03:38 PM
The description texts are rendered as HTML.

Use <br> instead.

02-29-2012, 05:52 PM
Have tried this John and it works thank you.

Only problem now is that when I parse the HTML through a validator I get "document does not allow element "br" here.

Top of my page looks like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

I realise this is not specific to the script but any advice would be appreciated.


02-29-2012, 06:55 PM
Use 'not character data' comments around the code, ex:

<script type="text/javascript">
/* <![CDATA[ */

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://i26.tinypic.com/11l7ls0.jpg", "", "", "Nothing beats relaxing next to the pool when the weather is hot."],
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "_new", "Some day I'd like to explore these caves!"],
["http://i31.tinypic.com/119w28m.jpg", "", "", "What a beautiful scene with everything changing colors."] //<--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: "ondemand",
togglerid: ""

/* ]]> */

02-29-2012, 07:22 PM
You're a star!

Many thanks