Foros del Web » Programando para Internet » Javascript »

Ayuda Experto En Asp Y Javascript

Estas en el tema de Ayuda Experto En Asp Y Javascript en el foro de Javascript en Foros del Web. Tengo una pagina en javascript que me muestra unas imagenes, al hacer click sobre alguna de ellas me muestra en otra parte de la pagina ...
  #1 (permalink)  
Antiguo 18/02/2004, 09:39
 
Fecha de Ingreso: mayo-2003
Mensajes: 866
Antigüedad: 21 años
Puntos: 0
Exclamación Ayuda Experto En Asp Y Javascript

Tengo una pagina en javascript que me muestra unas imagenes, al hacer click sobre alguna de ellas me muestra en otra parte de la pagina un texto y otra imagen,LO QUE PRETENDO es obtener el array desde una base(ESTO LO CONSIGO, es lo que esta de color rojo)
de datos con asp y que mesiga mostrando lo mismo al hacer click con una imagen (ESTO NO LO CONSIGO).
El array lo obtengo en asp de esta forma:

PAGINA ASP
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #include file="db.asp" -->
<html>
<head>
<title>Array desde Recordset</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
strSQL="SELECT * FROM productos"
set rs=db.execute(strSQL)%>
<SCRIPT language="JavaScript">
<!--
//Llena el array con el contenido del recordset
var capamodelo() = new Array;
<%
intCount = 1
do until rs.eof
strdescripcion = rs("descripcion")
strimagen1= rs("imagen1")
strimagen2 = rs("imagen2")
response.write "capamodelo[" & "'tela" & intCount & "] = " & strdescripcion & chr(13)
response.write "capamodelo[" & "'tela" & intCount & "img" & "] = " & strimagen1 & chr(13)
response.write "capamodelo[" & "'tela" & intCount & "tit" & "] = " & strimagen2 & chr(13)
intCount = intCount + 1
rs.movenext
loop
%>
// -->
</SCRIPT>

</body>
</html>
FIN PAGINA ASP
PAGINA JAVASCRIPT
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<HTML><HEAD><TITLE>Pagina javascript</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE type=text/css>#contexto1 {
Z-INDEX: 200; LEFT: 367px; CLIP: rect(0px 392px 135px 0px); POSITION: absolute; TOP: 25px
}
#scrolltext1 {
Z-INDEX: 1; LEFT: 0px; POSITION: absolute; TOP: 0px
}
#scrollabajo {
Z-INDEX: 20; LEFT: 560px; VISIBILITY: hidden; POSITION: absolute; TOP: 150px
}
#scrollarriba {
Z-INDEX: 20; LEFT: 560px; VISIBILITY: hidden; POSITION: absolute; TOP: 35px
}
#imagen {
Z-INDEX: 230; LEFT: 205px; POSITION: absolute; TOP: 1px
}
#rotulo {
Z-INDEX: 220; LEFT: 363px; POSITION: absolute; TOP: 5px
}
A {
FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: 'Arial'
}
A.scroll {
COLOR: #ffffff
}
STRONG {
FONT-WEIGHT: bold; FONT-SIZE: 15pt; LINE-HEIGHT: 25pt; FONT-FAMILY: 'Arial'
}
P {
FONT-SIZE: 8pt; LINE-HEIGHT: 13pt; FONT-FAMILY: 'Arial'
}
A.pepe {
BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px; TEXT-DECORATION: none
}
</STYLE>

<SCRIPT language=JavaScript>
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
</SCRIPT>

<SCRIPT language=JavaScript>
ns = (document.layers)? true:false
ie = (document.all)? true:false
var doc = (ie) ? "document.all." : "document.";
var stl = (ie) ? ".style." : ".";
var timer3, timerscroll, timerclip, timerscrollmove;

//Capas
capamodelo = new Array()
capamodelo['tela1'] = '<table border="0" width="195" cellpadding="2" cellspacing="0"><tr> <td valign="top"><font face="Arial" size=1><br>Descripcion1<br></font></td> </tr></table>'
capamodelo['tela1img'] = '<img src="imagenes/carro.jpg" border="0">'
capamodelo['tela1tit'] = '<img src="imagenes/tit_01.gif" border="0">'

capamodelo['tela2'] = '<table border="0" width="195" cellpadding="2" cellspacing="0"> <tr> <td valign="top"><font face="Arial" size=1><br>Descripcion2</font></td> </tr></table>'
capamodelo['tela2img'] ='<img src="imagenes/carro.jpg" border="0">'
capamodelo['tela2tit'] ='<img src="imagenes/tit_02.gif" border="0">'

capamodelo['tela3'] ='<table border="0" width="195" cellpadding="2" cellspacing="0"> <tr> <td valign="top"><font face="Arial" size=1>Descripcion3</font></td> </tr> </table>'
capamodelo['tela3img'] ='<img src="imagenes/print.jpg" border="0">'
capamodelo['tela3tit'] ='<img src="imagenes/tit_03.gif" border="0">'

capamodelo['tela4'] ='<table border="0" width="195" cellpadding="2" cellspacing="0"> <tr> <td valign="top"><font face="Arial" size=1>Descripcion4</font></td> </tr> </table>'
capamodelo['tela4img'] ='<img src="imagenes/print.jpg" border="0">'
capamodelo['tela4tit'] ='<img src="imagenes/tit_04.gif" border="0">'

capamodelo['tela5'] = '<table border="0" width="195" cellpadding="2" cellspacing="0"><tr> <td valign="top"><font face="Arial" size=1>Descripcion5</font></td> </tr></table>'
capamodelo['tela5img'] ='<img src="imagenes/print.jpg" border="0">'
capamodelo['tela5tit'] ='<img src="imagenes/tit_05.gif" border="0">'

capamodelo['tela6'] ='<table border="0" width="195" cellpadding="2" cellspacing="0"> <tr><td valign="top"><font face="Arial" size=1>Descripcion6</font></td> </tr> </table>'
capamodelo['tela6img'] ='<img src="imagenes/print.jpg" border="0">'
capamodelo['tela6tit'] ='<img src="imagenes/tit_06.gif" border="0">'
function writeModel(cual) {

capauno = (ie) ? eval("scrolltext1") : document.contexto1.document.scrolltext1
altotmp = (ie) ? capauno.offsetHeight : 0
cpimagen = (ie) ? imagen : document.imagen
cprotulo = (ie) ? rotulo : document.rotulo

MM_showHideLayers('scrollarriba','','show','scroll abajo','','show')

if (ns) {

capauno.top = 0
capauno.document.open()
capauno.document.write(capamodelo[cual])
capauno.document.close()

cprotulo.document.open()
cprotulo.document.write(capamodelo[cual+'tit'])
cprotulo.document.close()


cpimagen.document.open()
cpimagen.document.write(capamodelo[cual+'img'])
cpimagen.document.close()

}//End ns

if (ie) {
capauno.style.top = 0
scrolltext1.innerHTML = capamodelo[cual]
imagen.innerHTML = capamodelo[cual+'img']
rotulo.innerHTML = capamodelo[cual+'tit']

}

MM_showHideLayers('barrabaja','','show','presentac ion','','hide','ir-a','','show','marco','','hide')

}


</SCRIPT>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV id=imagen></DIV>
<DIV id=rotulo></DIV>
<DIV id=contexto1>
<DIV id=scrolltext1></DIV></DIV>
<DIV id=scrollabajo><A onmouseover="scrollp2('arriba','1');"
onmouseout="scrollp2('limpia','1');"
href="bosque7.asp#"><IMG
src="imagenes/flecha_abajo.gif" border=0></A></DIV>
<DIV id=scrollarriba><A onmouseover="scrollp2('abajo','1')"
onmouseout="scrollp2('limpia','1');"
href="bosque7.asp#"><IMG
src="imagenes/flecha_arriba.gif" border=0></A></DIV>
<DIV id=barrabaja
style="Z-INDEX: 100; LEFT: 204px; VISIBILITY: visible; WIDTH: 56px; POSITION: absolute; TOP: 162px; HEIGHT: 55px"
;>
<TABLE cellSpacing=0 cellPadding=0 width=300 border=0>
<TBODY>
<TR><%'usa imagenes en FORMATO gIF%>
<TD noWrap><A onclick="writeModel('tela1')"
href="bosque7.asp#"><IMG
alt="Paterna fresa" src="imagenes/01.gif" border=0></A><A
onclick="writeModel('tela2')"
href="bosque7.asp#"><IMG
alt="Medina verde" src="imagenes/02.gif" border=0></A><A
onclick="writeModel('tela3')"
href="bosque7.asp#"><IMG
alt="Aran fresa" src="imagenes/03.gif" border=0></A><A
onclick="writeModel('tela4')"
href="bosque7.asp#"><IMG
alt="Coín fresa" src="imagenes/04.gif" border=0></A><A
onclick="writeModel('tela5')"
href="bosque7.asp#"><IMG
alt="Benarés caldero" src="imagenes/05.gif" border=0></A><A
onclick="writeModel('tela6')"
href="bosque7.asp#"><IMG
alt="Montserrat caldero" src="imagenes/06.gif"
border=0></A></TD></TR></TBODY></TABLE></DIV>
<%'fin usa imagenes en FORMATO gIF%>
<DIV id=presentacion
style="Z-INDEX: 100; LEFT: 207px; VISIBILITY: visible; WIDTH: 56px; POSITION: absolute; TOP: 23px; HEIGHT: 55px">
<TABLE cellSpacing=0 cellPadding=0 width=375 border=0>
<TBODY>
<TR>
<TD width=20></TD>
<TD vAlign=top>
<P align=justify>TEXTO1</P></TD>
<TD width=20></TD></TR></TBODY></TABLE></DIV>
<DIV id=marco
style="Z-INDEX: 10; LEFT: 205px; VISIBILITY: visible; POSITION: absolute; TOP: 1px">
<TABLE cellSpacing=0 cellPadding=2 width=375 border=0>
<TBODY>
<TR>
<TD vAlign=top><IMG src="imagenes/marco.jpg"
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV id=ir-a
style="Z-INDEX: 100; LEFT: 4px; VISIBILITY: visible; WIDTH: 56px; POSITION: absolute; TOP: 192px; HEIGHT: 55px">
<TABLE cellSpacing=0 cellPadding=2 width=175 border=0>
<TBODY>
<TR>
<TD width=175><IMG src="imagenes/amb-febrero.jpg"
border=0></TD></TR></TBODY></TABLE></DIV>
<TABLE cellSpacing=0 cellPadding=0 width=200 border=0>
<TBODY>
<TR>
<TD align=middle><A
onclick="MM_openBrWindow('bosque2.asp','','width=3 46,height=430')"
href="bosque7.asp#"><IMG
src="imagenes/flores2.jpg" border=0></A></TD>
<TD width=20></TD></TR>
<TR>
<TD vAlign=top width=150 colSpan=2></TD></TR></TBODY></TABLE></BODY></HTML>

FIN PAGINA JAVASCRIPT

Última edición por sqa212; 19/02/2004 a las 07:04
  #2 (permalink)  
Antiguo 18/02/2004, 11:21
 
Fecha de Ingreso: enero-2002
Mensajes: 1.438
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Ayuda Experto En Asp Y Javascript

Cita:
Mensaje Original por sqa212
[B]Tengo una pagina en javascript que me muestra unas imagenes, al hacer click sobre alguna de ellas me muestra en otra parte de la pagina un texto y otra imagen,LO QUE PRETENDO es obtener el array desde una base(ESTO LO CONSIGO)
de datos con asp y que mesiga mostrando lo mismo al hacer click con una imagen (ESTO NO LO CONSIGO).

No termino de entender la pregunta.

Podrias replantearla, teniendo en cuenta, que el codigo ASP se ejecuta en servidor

y en codigo JScript se ejecuta en cliente.

esto quiere decir, que si que si parte del codigo ASP depende de alguna orden Jscript, vas a tener problemas.
  #3 (permalink)  
Antiguo 18/02/2004, 16:37
 
Fecha de Ingreso: mayo-2003
Mensajes: 866
Antigüedad: 21 años
Puntos: 0
Te comento, con asp lo unico que hago es traer los elementos que van a ser introducidos en el array de javascript, luego quiero mostrar en primer lugar unas imagenes, al hacer click sobre una de ellas se muestra en la misma pantalla en ptra parte un texto y otra imagen.
Lo unico que hago con Asp es traer los elementos que van a formar el array en javascript.
  #4 (permalink)  
Antiguo 19/02/2004, 07:06
 
Fecha de Ingreso: mayo-2003
Mensajes: 866
Antigüedad: 21 años
Puntos: 0
Ninguna ideA
  #5 (permalink)  
Antiguo 20/02/2004, 08:47
 
Fecha de Ingreso: octubre-2003
Ubicación: ***
Mensajes: 152
Antigüedad: 20 años, 6 meses
Puntos: 0
te pongo algo..

desde ASP
sql="consulta"
ObjRecordSet.Open Sql, cn
cn.execute Sql

<SCRIPT LANGUAGE="JavaScript">

<%
y=0
do while Not ObjRecordSet2.EOF
%>
x = <%= trim(y) %>;

matriz = new Array(); //--> esto no donde lo tendras q poner depende de lo q quieras

imagen = "<%=(ObjRecordSet("imagen")) %>";
texto = "<%=(ObjRecordSet("texto"))%>";
matriz[x,0] = imagen;
matriz[x,1] = texto;
<%
y = y + 1
ObjRecordSet.movenext
loop
ObjRecordSet.close
%>
</script>

Última edición por _Brian_; 20/02/2004 a las 08:48
  #6 (permalink)  
Antiguo 20/02/2004, 08:55
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
sqa212,

lo mejor es que dejes el código que obtienes una vez se ha generado la página desde asp.

Es decir, pon el código resultante que llega al navegador para ver qué parte del script del lado cliente está fallando
  #7 (permalink)  
Antiguo 20/02/2004, 15:18
 
Fecha de Ingreso: mayo-2003
Mensajes: 866
Antigüedad: 21 años
Puntos: 0
ahi va

he señalado de rojo el codigo en asp y en azul las lineas donde da el error (Se esperaba un objeto)

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #include file="db.asp" -->
<HTML><HEAD><TITLE>Pagina javascript</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE type=text/css>#contexto1 {
Z-INDEX: 200; LEFT: 367px; CLIP: rect(0px 392px 135px 0px); POSITION: absolute; TOP: 25px
}
#scrolltext1 {
Z-INDEX: 1; LEFT: 0px; POSITION: absolute; TOP: 0px
}
#scrollabajo {
Z-INDEX: 20; LEFT: 560px; VISIBILITY: hidden; POSITION: absolute; TOP: 150px
}
#scrollarriba {
Z-INDEX: 20; LEFT: 560px; VISIBILITY: hidden; POSITION: absolute; TOP: 35px
}
#imagen {
Z-INDEX: 230; LEFT: 205px; POSITION: absolute; TOP: 1px
}
#rotulo {
Z-INDEX: 220; LEFT: 363px; POSITION: absolute; TOP: 5px
}
A {
FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: 'Arial'
}
A.scroll {
COLOR: #ffffff
}
STRONG {
FONT-WEIGHT: bold; FONT-SIZE: 15pt; LINE-HEIGHT: 25pt; FONT-FAMILY: 'Arial'
}
P {
FONT-SIZE: 8pt; LINE-HEIGHT: 13pt; FONT-FAMILY: 'Arial'
}
A.pepe {
BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px; TEXT-DECORATION: none
}
</STYLE>

<SCRIPT language=JavaScript>
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
</SCRIPT>

<SCRIPT language=JavaScript>
ns = (document.layers)? true:false
ie = (document.all)? true:false
var doc = (ie) ? "document.all." : "document.";
var stl = (ie) ? ".style." : ".";
var timer3, timerscroll, timerclip, timerscrollmove;

<%
strSQL="SELECT * FROM productos"
set rs=db.execute(strSQL)%>


capamodelo = new Array()

<%
intCount = 1
do until rs.eof
strdescripcion = rs("descripcion")
strimagen1= rs("imagen1")
strimagen2 = rs("imagen2")
response.write "capamodelo[" & "'tela" & intCount & "] = " & strdescripcion & chr(13)
response.write "capamodelo[" & "'tela" & intCount & "img" & "] = " & strimagen1 & chr(13)
response.write "capamodelo[" & "'tela" & intCount & "tit" & "] = " & strimagen2 & chr(13)
intCount = intCount + 1
rs.movenext
loop
%>

function writeModel(cual) {

capauno = (ie) ? eval("scrolltext1") : document.contexto1.document.scrolltext1
altotmp = (ie) ? capauno.offsetHeight : 0
cpimagen = (ie) ? imagen : document.imagen
cprotulo = (ie) ? rotulo : document.rotulo

MM_showHideLayers('scrollarriba','','show','scroll abajo','','show')

if (ns) {

capauno.top = 0
capauno.document.open()
capauno.document.write(capamodelo[cual])
capauno.document.close()

cprotulo.document.open()
cprotulo.document.write(capamodelo[cual+'tit'])
cprotulo.document.close()


cpimagen.document.open()
cpimagen.document.write(capamodelo[cual+'img'])
cpimagen.document.close()

}//End ns

if (ie) {
capauno.style.top = 0
scrolltext1.innerHTML = capamodelo[cual]
imagen.innerHTML = capamodelo[cual+'img']
rotulo.innerHTML = capamodelo[cual+'tit']

}

MM_showHideLayers('barrabaja','','show','presentac ion','','hide','ir-a','','show','marco','','hide')

}


</SCRIPT>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV id=imagen></DIV>
<DIV id=rotulo></DIV>
<DIV id=contexto1>
<DIV id=scrolltext1></DIV></DIV>
<DIV id=scrollabajo><A onmouseover="scrollp2('arriba','1');"
onmouseout="scrollp2('limpia','1');"
href="bosque10.asp#"><IMG
src="imagenes/flecha_abajo.gif" border=0></A></DIV>
<DIV id=scrollarriba><A onmouseover="scrollp2('abajo','1')"
onmouseout="scrollp2('limpia','1');"
href="bosque10.asp#"><IMG
src="imagenes/flecha_arriba.gif" border=0></A></DIV>
<DIV id=barrabaja
style="Z-INDEX: 100; LEFT: 204px; VISIBILITY: visible; WIDTH: 56px; POSITION: absolute; TOP: 162px; HEIGHT: 55px"
;>
<TABLE cellSpacing=0 cellPadding=0 width=300 border=0>
<TBODY>
<TR>
<TD noWrap><A onclick="writeModel('tela1')"
href="bosque10.asp#"><IMG
alt="Paterna fresa" src="imagenes/01.gif" border=0></A><A
onclick="writeModel('tela2')"
href="bosque10.asp#"><IMG
alt="Medina verde" src="imagenes/02.gif" border=0></A><A
onclick="writeModel('tela3')"
href="bosque10.asp#"><IMG
alt="Aran fresa" src="imagenes/03.gif" border=0></A><A
onclick="writeModel('tela4')"
href="bosque10.asp#"><IMG
alt="Coín fresa" src="imagenes/04.gif" border=0></A><A
onclick="writeModel('tela5')"
href="bosque10.asp#"><IMG
alt="Benarés caldero" src="imagenes/05.gif" border=0></A><A
onclick="writeModel('tela6')"
href="bosque10.asp#"><IMG
alt="Montserrat caldero" src="imagenes/06.gif"
border=0></A></TD></TR></TBODY></TABLE></DIV>

<DIV id=presentacion
style="Z-INDEX: 100; LEFT: 207px; VISIBILITY: visible; WIDTH: 56px; POSITION: absolute; TOP: 23px; HEIGHT: 55px">
<TABLE cellSpacing=0 cellPadding=0 width=375 border=0>
<TBODY>
<TR>
<TD width=20></TD>
<TD vAlign=top>
<P align=justify>TEXTO1</P></TD>
<TD width=20></TD></TR></TBODY></TABLE></DIV>
<DIV id=marco
style="Z-INDEX: 10; LEFT: 205px; VISIBILITY: visible; POSITION: absolute; TOP: 1px">
<TABLE cellSpacing=0 cellPadding=2 width=375 border=0>
<TBODY>
<TR>
<TD vAlign=top><IMG src="imagenes/marco.jpg"
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV id=ir-a
style="Z-INDEX: 100; LEFT: 4px; VISIBILITY: visible; WIDTH: 56px; POSITION: absolute; TOP: 192px; HEIGHT: 55px">
<TABLE cellSpacing=0 cellPadding=2 width=175 border=0>
<TBODY>
<TR>
<TD width=175><IMG src="imagenes/amb-febrero.jpg"
border=0></TD></TR></TBODY></TABLE></DIV>
<TABLE cellSpacing=0 cellPadding=0 width=200 border=0>
<TBODY>
<TR>
<TD align=middle><A
onclick="MM_openBrWindow('bosque10.asp','','width= 346,height=430')"
href="bosque10.asp#"><IMG
src="imagenes/flores2.jpg" border=0></A></TD>
<TD width=20></TD></TR>
<TR>
<TD vAlign=top width=150 colSpan=2></TD></TR></TBODY></TABLE></BODY></HTML>
  #8 (permalink)  
Antiguo 21/02/2004, 11:18
 
Fecha de Ingreso: mayo-2003
Mensajes: 866
Antigüedad: 21 años
Puntos: 0
Te refieres a esto tunait?

<HTML><HEAD><TITLE>Pagina javascript</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE type=text/css>#contexto1 {
Z-INDEX: 200; LEFT: 367px; CLIP: rect(0px 392px 135px 0px); POSITION: absolute; TOP: 25px
}
#scrolltext1 {
Z-INDEX: 1; LEFT: 0px; POSITION: absolute; TOP: 0px
}
#scrollabajo {
Z-INDEX: 20; LEFT: 560px; VISIBILITY: hidden; POSITION: absolute; TOP: 150px
}
#scrollarriba {
Z-INDEX: 20; LEFT: 560px; VISIBILITY: hidden; POSITION: absolute; TOP: 35px
}
#imagen {
Z-INDEX: 230; LEFT: 205px; POSITION: absolute; TOP: 1px
}
#rotulo {
Z-INDEX: 220; LEFT: 363px; POSITION: absolute; TOP: 5px
}
A {
FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: 'Arial'
}
A.scroll {
COLOR: #ffffff
}
STRONG {
FONT-WEIGHT: bold; FONT-SIZE: 15pt; LINE-HEIGHT: 25pt; FONT-FAMILY: 'Arial'
}
P {
FONT-SIZE: 8pt; LINE-HEIGHT: 13pt; FONT-FAMILY: 'Arial'
}
A.pepe {
BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px; TEXT-DECORATION: none
}
</STYLE>

<SCRIPT language=JavaScript>
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
</SCRIPT>

<SCRIPT language=JavaScript>
ns = (document.layers)? true:false
ie = (document.all)? true:false
var doc = (ie) ? "document.all." : "document.";
var stl = (ie) ? ".style." : ".";
var timer3, timerscroll, timerclip, timerscrollmove;



capamodelo = new Array()

capamodelo['tela1] = '<table border="0" width="195" cellpadding="2" cellspacing="0"><tr><td valign="top"><font face="Arial" size=1>Ref: 548058<br>en un elegante y luminoso tono fresa que combina perfectamente con toda la colección.<br> 100% algodón / ancho 1.40 m /1, rubito</font></td></tr></table>'
capamodelo['tela1img] = '<img src="imagenes/01.gif">'
capamodelo['tela1tit] = '<img src="imagenes/spain.gif">'
capamodelo['tela2] = '<table border="0" width="195" cellpadding="2" cellspacing="0"><tr><td valign="top"><font face="Arial" size=1>Ref: 548058<br> colección.<br> 100% algodón / ancho 1.40 m /1, 5316 yards.</font></td></tr></table>'
capamodelo['tela2img] = '<img src="imagenes/02.gif">'
capamodelo['tela2tit] = '<img src="imagenes/spain.gif">'
capamodelo['tela3] = '<table border="0" width="195" cellpadding="2" cellspacing="0"><tr><td valign="top"><font face="Arial" size=1>Ref: 548058<br><br> 100% algodón / ancho 1.40 m /1, 5316 yards.</font></td></tr></table>'
capamodelo['tela3img] = '<img src="imagenes/03.gif">'
capamodelo['tela3tit] = '<img src="imagenes/spain.gif">'
capamodelo['tela4] = '<table border="0" width="195" cellpadding="2" cellspacing="0"><tr><td valign="top"><font face="Arial" size=1>Ref: 548058<br>.<br> 100% algodón / ancho 1.40 m /1, 5316 yards.</font></td></tr></table>'
capamodelo['tela4img] = '<img src="imagenes/04.gif">'
capamodelo['tela4tit] = '<img src="imagenes/spain.gif">'
capamodelo['tela5] = '<table border="0" width="195" cellpadding="2" cellspacing="0"><tr><td valign="top"><font face="Arial" size=1>Ref: 548058<br><br> 100% algodón / ancho 1.40 m /1, 5316 yards.</font></td></tr></table>'
capamodelo['tela5img] = '<img src="imagenes/05.gif">'
capamodelo['tela5tit] = '<img src="imagenes/spain.gif">'
capamodelo['tela6] = '<table border="0" width="195" cellpadding="2" cellspacing="0"><tr><td valign="top"><font face="Arial" size=1>Ref: 548058<br><br> 100% algodón / ancho 1.40 m /1, 5316 yards.</font></td></tr></table>'
capamodelo['tela6img] = '<img src="imagenes/06.gif">'
capamodelo['tela6tit] = '<img src="imagenes/spain.gif">'

function writeModel(cual) {

capauno = (ie) ? eval("scrolltext1") : document.contexto1.document.scrolltext1
altotmp = (ie) ? capauno.offsetHeight : 0
cpimagen = (ie) ? imagen : document.imagen
cprotulo = (ie) ? rotulo : document.rotulo

MM_showHideLayers('scrollarriba','','show','scroll abajo','','show')

if (ns) {

capauno.top = 0
capauno.document.open()
capauno.document.write(capamodelo[cual])
capauno.document.close()

cprotulo.document.open()
cprotulo.document.write(capamodelo[cual+'tit'])
cprotulo.document.close()


cpimagen.document.open()
cpimagen.document.write(capamodelo[cual+'img'])
cpimagen.document.close()

}//End ns

if (ie) {
capauno.style.top = 0
scrolltext1.innerHTML = capamodelo[cual]
imagen.innerHTML = capamodelo[cual+'img']
rotulo.innerHTML = capamodelo[cual+'tit']

}

MM_showHideLayers('barrabaja','','show','presentac ion','','hide','ir-a','','show','marco','','hide')

}


</SCRIPT>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV id=imagen></DIV>
<DIV id=rotulo></DIV>
<DIV id=contexto1>
<DIV id=scrolltext1></DIV></DIV>
<DIV id=scrollabajo><A onmouseover="scrollp2('arriba','1');"
onmouseout="scrollp2('limpia','1');"
href="bosque10.asp#"><IMG
src="imagenes/flecha_abajo.gif" border=0></A></DIV>
<DIV id=scrollarriba><A onmouseover="scrollp2('abajo','1')"
onmouseout="scrollp2('limpia','1');"
href="bosque10.asp#"><IMG
src="imagenes/flecha_arriba.gif" border=0></A></DIV>
<DIV id=barrabaja
style="Z-INDEX: 100; LEFT: 204px; VISIBILITY: visible; WIDTH: 56px; POSITION: absolute; TOP: 162px; HEIGHT: 55px"
;>
<TABLE cellSpacing=0 cellPadding=0 width=300 border=0>
<TBODY>
<TR>
<TD noWrap><A onclick="writeModel('tela1')"
href="bosque10.asp#"><IMG
alt="Paterna fresa" src="imagenes/01.gif" border=0></A><A
onclick="writeModel('tela2')"
href="bosque10.asp#"><IMG
alt="Medina verde" src="imagenes/02.gif" border=0></A><A
onclick="writeModel('tela3')"
href="bosque10.asp#"><IMG
alt="Aran fresa" src="imagenes/03.gif" border=0></A><A
onclick="writeModel('tela4')"
href="bosque10.asp#"><IMG
alt="Coín fresa" src="imagenes/04.gif" border=0></A><A
onclick="writeModel('tela5')"
href="bosque10.asp#"><IMG
alt="Benarés caldero" src="imagenes/05.gif" border=0></A><A
onclick="writeModel('tela6')"
href="bosque10.asp#"><IMG
alt="Montserrat caldero" src="imagenes/06.gif"
border=0></A></TD></TR></TBODY></TABLE></DIV>

<DIV id=presentacion
style="Z-INDEX: 100; LEFT: 207px; VISIBILITY: visible; WIDTH: 56px; POSITION: absolute; TOP: 23px; HEIGHT: 55px">
<TABLE cellSpacing=0 cellPadding=0 width=375 border=0>
<TBODY>
<TR>
<TD width=20></TD>
<TD vAlign=top>
<P align=justify>TEXTO1</P></TD>
<TD width=20></TD></TR></TBODY></TABLE></DIV>
<DIV id=marco
style="Z-INDEX: 10; LEFT: 205px; VISIBILITY: visible; POSITION: absolute; TOP: 1px">
<TABLE cellSpacing=0 cellPadding=2 width=375 border=0>
<TBODY>
<TR>
<TD vAlign=top><IMG src="imagenes/marco.jpg"
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV id=ir-a
style="Z-INDEX: 100; LEFT: 4px; VISIBILITY: visible; WIDTH: 56px; POSITION: absolute; TOP: 192px; HEIGHT: 55px">
<TABLE cellSpacing=0 cellPadding=2 width=175 border=0>
<TBODY>
<TR>
<TD width=175><IMG src="imagenes/amb-febrero.jpg"
border=0></TD></TR></TBODY></TABLE></DIV>
<TABLE cellSpacing=0 cellPadding=0 width=200 border=0>
<TBODY>
<TR>
<TD align=middle><A
onclick="MM_openBrWindow('bosque10.asp','','width= 346,height=430')"
href="bosque10.asp#"><IMG
src="imagenes/flores2.jpg" border=0></A></TD>
<TD width=20></TD></TR>
<TR>
<TD vAlign=top width=150 colSpan=2></TD></TR></TBODY></TABLE></BODY></HTML>

Última edición por sqa212; 21/02/2004 a las 11:21
  #9 (permalink)  
Antiguo 23/02/2004, 06:03
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Qué tal,

mira, me ha parecido un tanto liado el script, aparte de que da muchas vueltas para hacer algo que en realidad es mucho más sencillo de hacer. Me puede llevar horas revisar el script, sólo tratando de entender qué hace y por qué lo hace así.

Si te he entendido bien, necesitas tener una serie de imágenes que al pincharlas deben mostrarse sus equivalentes en grande junto con una descripción y esos datos deben salir de una base de datos.

Te he preparado un ejemplo desde cero de cómo hacer lo mismo. A partir del ejemplo realiza las modificaciones que te parezcan oportunas, tal vez te sirva el hacer una adaptación.

Mira a ver si algo así te sirve

<script language="JavaScript" type="text/javascript">
function Imagen(origenp,origeng,texto){
this.origenp = origenp
this.origeng = origeng
this.texto = texto
}
var lista = new Array()
<%
strSQL="SELECT * FROM productos"
set rs=db.execute(strSQL)
intCount = 1
do until rs.eof
strdescripcion = rs("descripcion")
strimagen1= rs("imagen1")
strimagen2 = rs("imagen2")
response.write "lista[" & intCount-1 & "] = new Imagen('" & strimagen1 & "','" & strimagen2 & "','" & strdescripcion & "')" & vbnewline
intCount = intCount + 1
rs.movenext
loop
%>
function cambiaImagen(cual){
document.getElementById('ima').src = lista[cual].origeng
document.getElementById('desc').firstChild.nodeVal ue = lista[cual].texto
}
function escribe(){
for (m=0; m< lista.length; m++){
document.write ('<img src="' + lista[m].origenp + '" onclick="cambiaImagen(' + m + ')">')
}

}
</script>
</head>

<body>
<table width="100%" border="0">
<tr>
<td align="center">
<script language="JavaScript" type="text/javascript">
escribe()
</script>
</td>
</tr>
<tr>
<td align="center"><img src="trans.gif" name="ima" id="ima" /></td>
</tr>
<tr>
<td align="center" id="desc">descripci&oacute;n</td>
</tr>
</table>
</body>
</html>

Falta que añadas en las primeras líneas la declaración de vbscript y la conexión.

Yá me dirás si te sirvió de algo.

un saludo
  #10 (permalink)  
Antiguo 25/02/2004, 19:10
 
Fecha de Ingreso: mayo-2003
Mensajes: 866
Antigüedad: 21 años
Puntos: 0
Gracias tunait , no sabes la de vueltas que le habia dado, porque de javascript, se cero coma cero.
Visite tu web, enhorabuena.
  #11 (permalink)  
Antiguo 26/02/2004, 05:01
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Óle me alegra que lo solucionaras

Cita:
Visite tu web, enhorabuena
Muchas gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:27.