Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Inside

Fotos em Slide

Recommended Posts

Caros amigos,

 

preciso solucionar um problema tenho este código que gera fotos em Slide, tudo certo, mas as fotos também teriam que ter legenda mas não sei como implantar a legenda neste script, isto é, ao trocar a foto a legenda da foto também teria que trocar.

 

Como posso fazer isto?

 

O nome das fotos está em Pic[numero] e nesta linha:

<img src="49.jpg" name="SlideShow"> Inicia a primeira fot do slide.

 

<script language="JavaScript" type="text/JavaScript">  // Set slideShowSpeed (milliseconds) var slideShowSpeed = 6000  // Duration of crossfade (seconds) var crossFadeDuration = 3  // Specify the image files var Pic = new Array() // don't touch this // to add more images, just continue // the pattern, adding to the array belowPic[1] = '46.jpg'Pic[2] = '47.jpg'Pic[3] = '48.jpg' var t var j = 1 var p = Pic.length var pos = j  var preLoad = new Array()  function preLoadPic(index) {		 if (Pic[index] != ''){				 window.status='Loading : '+Pic[index]				 preLoad[index] = new Image()				 preLoad[index].src = Pic[index]				 Pic[index] = ''				 window.status=''		 } }  function runSlideShow(){	if (document.all){			 document.images.SlideShow.style.filter="blendTrans(duration=2)"				 document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)"	   document.images.SlideShow.filters.blendTrans.Apply()		 }		 document.images.SlideShow.src = preLoad[j].src		 if (document.all){			document.images.SlideShow.filters.blendTrans.Play()		 }		 		 pos = j 		 j = j + 1		 if (j > (p-1)) j=1		 t = setTimeout('runSlideShow()', slideShowSpeed)		 preLoadPic(j) }  preLoadPic(j)</script><img src="46.jpg" name="SlideShow"><script language="JavaScript" type="text/JavaScript">runSlideShow()</script>

Compartilhar este post


Link para o post
Compartilhar em outros sites

da uma olhada se da certo...não testei

substitua ou acrescente conforme o seu script.

 

Pic[1] = '46.jpg';Leg[1] = 'lengenda 1';Pic[2] = '47.jpg';Leg[2] = 'lengenda 2';Pic[3] = '48.jpg';Leg[3] = 'lengenda 3';document.images.SlideShow.src = preLoad[j].src;document.getElementById('legenda').innerText = Leg[j];<img src="46.jpg" name="SlideShow"><div id='legenda'></div>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Prezado Fábio, muito obrigado.

 

Eu não entendo nada praticamente de Java Script mas eu tive que fazer umas alterações porque não estava dando certo com o codigo que você postou, dai funcionou:

 

Muito obrigado pela ajuda.

 

 

<script language="JavaScript" type="text/JavaScript">  // Set slideShowSpeed (milliseconds) var slideShowSpeed = 6000  // Duration of crossfade (seconds) var crossFadeDuration = 3  // Specify the image files var Pic = new Array() // don't touch this var Leg = new Array() // don't touch this // to add more images, just continue // the pattern, adding to the array belowPic[1] = '46.jpg'Pic[2] = '47.jpg'Pic[3] = '48.jpg'Leg[1] = 'Legenda 1'Leg[2] = 'Legenda 2'Leg[3] = 'Legenda 3' var t var j = 1 var p = Pic.length var pos = j  var preLoad = new Array()  function preLoadPic(index) {		 if (Pic[index] != ''){				 window.status='Loading : '+Pic[index]				 preLoad[index] = new Image()				 preLoad[index].src = Pic[index]				 Pic[index] = ''				 window.status=''		 } }  function runSlideShow(){	if (document.all){			 document.images.SlideShow.style.filter="blendTrans(duration=2)"				 document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)"	   document.images.SlideShow.filters.blendTrans.Apply()		 }		 document.images.SlideShow.src = preLoad[j].src		 document.getElementById('legenda').innerText = Leg[j]		 if (document.all){			document.images.SlideShow.filters.blendTrans.Play()		 }		 		 pos = j 		 j = j + 1		 if (j > (p-1)) j=1		 t = setTimeout('runSlideShow()', slideShowSpeed)		 preLoadPic(j) }  preLoadPic(j)</script><img src="46.jpg" name="SlideShow"><br><div id='legenda'></div><script language="JavaScript" type="text/JavaScript">runSlideShow()</script>

-----------------------------------------------------------------------------------

Post Mesclado

-----------------------------------------------------------------------------------

 

 

Caros amigos,

 

preciso de mais uma ajuda.

 

Nesse código acima, preciso que agora seja incluido uma função.

 

Função 1: Preciso que haja a possibilidade de clicar na foto para ampliala. Acho que o código seria isso, mas não funciona:

 

<a href="ver_foto.asp?f=46.jpg" name="SlideShow"><img src="46.jpg" name="SlideShow"></a>

Obrigado pela atençao de todos.

 

-----------------------------------------------------------------------------------

Post Mesclado

-----------------------------------------------------------------------------------

 

[...]

 

Ou que alguém saiba como transformar a legenda em HTML, tipo:

 

Leg[1] = '<a href="foto.asp?f=46.jpg"> Legenda 1</a>'

Obrigado.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.