Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/08/2009, 20:37
lordcortes
 
Fecha de Ingreso: agosto-2009
Mensajes: 11
Antigüedad: 14 años, 7 meses
Puntos: 0
Información Noticias y fotos en la web

Buenas noches a todos no se aquí este bien el tema si no me disculpan.

necesito ayuda con este código es un enlace de noticias que e puesto en una web de un cliente el problema es que el cliente quiere que las fotos que van pasando el pueda dar un click a cada una y se le amplíen hay forma de hacer esto??

el código:

<!--aqui inica las noticias-->

<script>
noticiero=new Array();

// Pon las noticias de la siguiente forma: new noticia(imagen, titulo,texto,enlace)

noticiero[1]=new noticia("fotos/STAR 0061.jpg","Texto","titulo","link");
noticiero[2]=new noticia("fotos/STAR 0061.jpg","Texto","titulo","link");
noticiero[3]=new noticia("fotos/STAR 0061.jpg","Texto","titulo","link");
noticiero[4]=new noticia("fotos/STAR 0061.jpg","Texto","titulo","link");
//noticiero[2]=...

espera=7 //Segundos de espera

function noticia(imagen,titulo,texto,enlace){
this.imagen=imagen;
this.texto=texto;
this.titulo=titulo
this.enlace=enlace
}
function obj(x){
return document.getElementById(x);

}
function mostrar(a){
obj('cuadro').style.visibility='hidden';
obj("imagen_noticia").src=noticiero[a].imagen;
obj("titulo_noticia").innerHTML=noticiero[a].titulo;
obj("texto_noticia").innerHTML=noticiero[a].texto;
obj("enlace").href=noticiero[a].enlace
}
b=0;
function cambiar(incr){
b=(noticiero.length>b+incr)?b+incr:0;
if(b==-1){b=noticiero.length-1;}
mostrar(b);
}



var pepe;

function inicio(){
pepe=setInterval("cambiar(1)",espera*1000);
}

</script>
<style>
#imagen_noticia{
float:up;
}
</style>


<body onload="inicio();mostrar(0);">
<div id="cuadro"><img src="" id="imagen_noticia" onload="obj('cuadro').style.visibility='visible'"/></a>
<p id="foto"></p>
<h3 id="titulo_noticia"></h3>
<p id="texto_noticia"></p>
<a href="#" id="enlace">Leer más</a><br />
<a href="#" onclick="clearInterval(pepe);cambiar(-1);inicio()">Anterior</a> | <a href="#" onclick="clearInterval(pepe)">Pausa</a> | <a href="#" onclick="clearInterval(pepe);cambiar(1);inicio()"> Siguiente</a>
</div>

<!--aqui termina las noticias-->


les agradezco desde ya su valiosa ayuda.