Ver Mensaje Individual
  #6 (permalink)  
Antiguo 25/01/2008, 13:57
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Re: hacer click en un <a>enlace</a> con una funcion?

Podrías probar con:
Código PHP:
<script>
addLoadEvent(function(){
showLightbox(document.getElementById('id_del_enlace_que querés mostrar'));
});
</script> 
Supongo que debe funcionar. Fijate que si cargás esta página: http://www.huddletogether.com/projects/lightbox/ y luego colocás en la barra de direcciones esto que sigue, al ejecutarlo se activa el lightbox sobre la primera imagen:
Código PHP:
javascriptshowLightbox(document.getElementsByTagName('a')[7]); 
Edito: en efecto, lo probé y funciona:
Código PHP:
<!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">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>Lightbox JS</title>
<
link rel="stylesheet" href="screen.css" type="text/css" media="screen" />
<
link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" />
<
script type="text/javascript" src="lightbox.js"></script>
<script>
addLoadEvent(function(){
showLightbox(document.getElementById('pp'));
});
</script>  
</head>

<body>
<a id="pp" href="image-1.jpg" rel="lightbox">image #1</a>
</body>
</html> 

Última edición por Panino5001; 26/01/2008 a las 06:14