Ver Mensaje Individual
  #14 (permalink)  
Antiguo 16/07/2009, 08:48
Avatar de acumulador
acumulador
 
Fecha de Ingreso: junio-2008
Ubicación: Medellin - Antiquia
Mensajes: 459
Antigüedad: 15 años, 10 meses
Puntos: 7
Respuesta: Imagen como boton

Cita:
Iniciado por acumulador Ver Mensaje
Bueno si es en php te recomiendo que crees una tabla con 2 frames; uno con las imagenes pequeñas y otro para cargar las imagenes, cuando den clic en la imagen pequeña envias por metodo GET un nombre de imagen, el cual lo va a buscar con php en la carpeta donde esten la imagenes y la muestras, ademas podes cambiar le tamaño con el width y el height.

Si te sirve mas trade que termine algo te subo el ejemplo por ahora te puedes guiar con esto.
Bueno lo prometido, ademas si alguien mas lo necesita.

En la pagina Html
la llamo galeria.html

<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!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=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<table width="550" height="368" border="0" align="center">
<tr>
<td height="87"><div align="center"><a href="fotos.php?fo=f_cuatro.jpg" target="carga"><img src="imagenes/f_cuatro.jpg" width="88" height="59" /></a>
<a href="fotos.php?fo=f_tres.jpg" target="carga"><img src="imagenes/f_tres.jpg" width="88" height="59" /></a>
<a href="fotos.php?fo=f_dos.jpg" target="carga"><img src="imagenes/f_dos.jpg" width="88" height="59" /></a>
<a href="fotos.php?fo=f_uno.jpg" target="carga"><img src="imagenes/f_uno.jpg" width="88" height="59" /></a>
</div></td>
</tr>
<tr>
<td><iframe src="fotos.php" name="carga" width="550" marginwidth="0" height="520" marginheight="0" align="top" scrolling="Auto" frameborder="0" id="carga"></iframe></td>
</tr>
</table>
</body>
</html>

Si te fijas loq ue se tiene es una tabla con 2 filas y una columna, enla segunda fila hay un ifame el cual sirve para cargar las fotos seleccionadas en la fila de arriba. La cual solo tien las imagenes pequeñas como hipervinculo y pasando una variable que llamo fo por con el metodo GET para recibirlo en la pagina que llamo fotos y tiene le php que recibe la variable e imprime la imagen en el tamaño que deseas.

Pagina fotos.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=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<?php

$myfot=$_GET['fo'];

?>
<center>
<img src="<?php echo "imagenes/".$myfot; ?>" width="450" height="450" alt="Imagen desde la Galeria" />
</center>
</body>
</html>

Aqui esta bien facil, solo tomo la varuiable y la muestro en una etiqueta img, pero en el src cargo la variable que viene por GET, adicional a esto le asigno un tamaño con width y heght.

Listo espero te sirva y sobre todo me comprendas por que la idea no es copiar si no aprender.
__________________
-----------------------------------------------------------------------------
Yo vivo de preguntar, saber no puede ser lujo...