Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/04/2005, 15:39
Avatar de lordtiger
lordtiger
 
Fecha de Ingreso: marzo-2005
Mensajes: 19
Antigüedad: 20 años, 2 meses
Puntos: 0
Exclamación Ver botones siguiente

Estimados,

En la pagina http://www.tattersall-propiedades.cl...rrelativo=0002

si hay mas de una foto, los botones funcionanperfectamente, pero como hago para que no se vean los botones cuando solo hay una foto.

Aki va el codigo que tengo de la tabla donde se muestran las fotos:

<%if not rs.eof then
consulta4 = consulta4 + "select * from imagenes where codtipo='" & request.querystring("codtipo")& "' and codregion='"& request.querystring("codregion")& "'"
consulta4 = consulta4 + " and codcomuna='"& request.querystring("codcomuna")& "' and correlativo='"& request.querystring("correlativo")& "'"
rs4.open consulta4, conexion

while not rs4.eof %>
<%

If arrFotos = "" Then
arrFotos = Trim(rs4.fields("archivo"))
Else
arrFotos = arrFotos&","&+ Trim(rs4.fields("archivo"))
Rs.MoveNext
'response.write arrFotos
%>

<%rs4.movenext
End If
wend
rs.movenext
end if%>
<%
Response.Write VBCrLf
Response.Write("<script>"&VBCrLf)
Response.Write("fotos = new Array()"&VBCrLf)
arrFotos = split(arrFotos,",")
for i = 0 to Ubound(arrFotos)
c = trim(arrFotos(i))
arrFotos(i)= c
'Response.Write( "<image src='http://www.tattersall-remates.cl\fotos\propiedades\catalogo\" & trim(rs4.fields("archivo")) &".jpg' width='280' height='220' alt='" & trim(rs4.fields("archivo")) &"'></a> ")
response.write("fotos["&i&"] = "&chr(34)&"http://www.tattersall-remates.cl/fotos/propiedades/catalogo/"&arrFotos(i)&".jpg"&chr(34)&""&VBCrLf&"")
Next
Response.Write("</script>")
%>
<table width="50" border="1" cellpadding="0" cellspacing="0" bordercolor="#003366">
<tr>
<td><img width="200" height="150" id="fotico"></td>
</tr>
</table>
<form>
<div align="center">

<input type="button" value=" anterior " onclick="pasa('i')">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;
<input type="button" value="siguiente" onclick="pasa('d')">
</div>
</form>
<script>
var afoto = new Array()
var idx=0
function inicio()
{
for (a=0;a<fotos.length;a++)
{
afoto[a] = new Image()
afoto[a].src = fotos[a]
}
muestra()
}

function pasa(dir)
{
if (dir=="i")
{
idx--
if (idx < 0) idx = afoto.length - 1
}
else
{
idx++
if (idx == afoto.length) idx = 0
}
muestra()
}

function muestra()
{
document.images["fotico"].src = afoto[idx].src
document.forms[0].leyenda.value = "Foto " + (idx+1) + " de " + afoto.length
}
</script>