...non va![]()
In pratica mi carica la prima foto, senza descrizione e non va + avanti.
Adesso riscrivo la funzione con la modifica che ho apportato:
codice:<script language="JavaScript"> function CacheImage(ImageSource) { var ImageObject = new Image(); ImageObject.src = ImageSource; return ImageObject; } function ShowSlide(Direction) { if (SlideReady) { NextSlide = CurrentSlide + Direction; document.SlideShow.Previous.disabled = (NextSlide == 0); document.SlideShow.Next.disabled = (NextSlide == (Slides.length-1)); if ((NextSlide >= 0) && (NextSlide < Slides.length)) { document.images['Screen'].src = Slides[NextSlide].src; document.getElementById('descrizione').innerHTML=DescrSlides[NextSlide]; CurrentSlide = NextSlide++; Message = 'Immagine ' + (CurrentSlide+1) + ' of ' + Slides.length; self.defaultStatus = Message; if (Direction == 1) CacheNextSlide(); } return true; } } function Download() { if (Slides[NextSlide].complete) { SlideReady = true; self.defaultStatus = Message; } else setTimeout("Download()", 100); return true; } function CacheNextSlide() { if ((NextSlide < Slides.length) && (typeof Slides[NextSlide] == 'string')) { SlideReady = false; self.defaultStatus = 'Downloading next picture...'; Slides[NextSlide] = CacheImage(Slides[NextSlide]); Download(); } return true; } function StartSlideShow() { CurrentSlide = -1; Slides[0] = CacheImage(Slides[0]); SlideReady = true; ShowSlide(1); } </script>
In rosso la stringa che ho inserito per recuperare l'elemento descrizione.
Nella pagina inoltre ho:
codice:<script language="JavaScript"> var Slides = new Array(<%=str_img_slide%>); </script> <script language="JavaScript"> var DescrSlides = new Array(<%=str_descr_slide%>); </script> ......... <table width="430" height="260" align="center" class="barra"> <tr> <td colspan="3" valign="top"> <img name="Screen" width="430" height="260"> </td> </tr> <tr> <td> <input type="button" name="Previous" value=" << " onClick="ShowSlide(-1)"> </td> <td> <div id="descrizione" align="center"><div> </td> <td align="right"> <input type="button" name="Next" value=" >> " onClick="ShowSlide(1)"> </td> </tr> </table>
Cosa mi consigliate????
Ciao

Rispondi quotando