javascript slideshow with caption

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default javascript slideshow with caption

    If I comment either one of the lines (image or caption) in each of the
    functions, then the other one will work fine in the slideshow. If they are
    both there, then the slideshow does not work. Any suggestions?

    SCRIPT LANGUAGE="JavaScript">

    var pic1 = "<CFOUTPUT
    query="photogroupings">/sites/images/#sites.imagedir#/#image1#</CFOUTPUT>"; /*
    Copy and paste if you want more pictures in your gallery i.e 'var pic4 =
    "apa.jpg"' aso. */
    var pic2 = "<CFOUTPUT
    query="photogroupings">/sites/images/#sites.imagedir#/#image2#</CFOUTPUT>";
    var pic3 = "<CFOUTPUT
    query="photogroupings">/sites/images/#sites.imagedir#/#image3#</CFOUTPUT>";
    var pic4 = "<CFOUTPUT
    query="photogroupings">/sites/images/#sites.imagedir#/#image4#</CFOUTPUT>";
    var number = <cfoutput>#variables.countimages#</cfoutput>; /*
    Number of pictures in your intended gallery */
    var vart = 1 ; /* Control variable, set to 1 just to know where
    it is */

    cap = new Array ();
    cap[1] = "<CFOUTPUT query="photogroupings">#description1#</CFOUTPUT>";
    cap[2] = "<CFOUTPUT query="photogroupings">#description2#</CFOUTPUT>";
    cap[3] = "<CFOUTPUT query="photogroupings">#description3#</CFOUTPUT>";
    cap[4] = "<CFOUTPUT query="photogroupings">#description4#</CFOUTPUT>";

    function next()
    {
    if (vart == number)
    document.getElementById("caption").innerHTML= cap[vart];
    document.gallery.src = eval("pic" + vart);

    else
    vart = vart + 1;
    document.getElementById("caption").innerHTML= cap[vart];
    document.gallery.src = eval("pic" + vart);
    }

    function previous()
    {
    if (vart == 1)
    document.getElementById("caption").innerHTML= cap[vart];
    document.gallery.src = eval("pic" + vart);

    else
    vart = vart - 1;
    document.getElementById("caption").innerHTML= cap[vart];
    document.gallery.src = eval("pic" + vart);
    }

    </SCRIPT>

    rboudwin Guest

  2. Similar Questions and Discussions

    1. mouseover text image/caption display
      One of my favorite web sites uses a very effective technique that links floating boxed captions (sample below) or thumbnails to selected text,...
    2. Close Caption options
      Hi all, I'm researching ways to include Close Caption text with our streaming videos. I found this tool...
    3. Caption for cfchart
      I have been experimenting with CFchart and need to know if there is a way to add a descriptive caption to the chart so that people will know what...
    4. image caption
      can any body can help me to find a com that can read the image caption .... image caption : some images can store some data like image caption it's...
    5. how to read image caption?
      can any body can help me to find a com that can read the image caption ... image caption : some images can store some data like image caption it's...
  3. #2

    Default Re: javascript slideshow with caption

    I figured it out. I removed the semicolons within the function and added {} around the two actions within the IF ELSE.
    rboudwin Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139