Saludos a todos.
Este es mi primer mensaje en este foro de Hispabyte,aunque os visito desde poco antes del cierre de prehackers.
Estoy haciendo mi 1? p?g. web,la cual podeis visitar en
http://www.iespana.es/La-Web-De-Max/index.html (por ahora en desarrollo) y me ha surgido un problema al colocar un archivo javascript.
El archivo funciona correctamente y hace lo que deberia pero ha generado un efecto secundario en la p?g.
Las im?genes animadas que est?n en formato gif se congelan en un fotograma aleatorio en el momento de
la ejecuci?n de la funci?n [ openandclose(visi) ] sobre cualquiera de sus elementos.
He de resaltar que este script ha sido tomado de internet y que simplemente lo he adaptado para que acepte
los estilos que he incluido en la p?g.
Tambi?n he estado comprobando los nombres de funciones y variables por si se repetian en otros scripts, aunque pudiera haber alguna parte en ellas que fueran similares pero desconozco cual es la forma de modificarlas.
Os agradeceria pudieras clarificarme el modo de solucionar este problema ya que sino deberia optar por
colocar im?genes fijas o buscar otro script que se adaptase mejor a la p?gina.
A?n asi me gustaria conocer la soluci?n ha este problema que sospecho tiene que ver con la carga de im?genes o del documento web.
Espero pueda seros de ayuda en el futuro aportando soluciones a vuestros problemas.
Adjunto copia del archivo javascript.
// EL SCRIPT EST? EN ARCHIVO .JS Y EN EL BODY EST? LA LLAMADA A LA FUNCI?N PRINCIPAL
// [ <bodyonLoad="openandclose(1000)"> ]
// ***********************************************************************************
var menublock=new Array()
var plus_i=0
menublock[0]="Inform?tica|#|;"+? ? ? ? ? ?? // text|URL|target of mainlink
? ? "Portales de inform?tica|submenu11.html|_top;"+? // text|URL|target of first sublink
? ? "Revistas de inform?tica|submenu12.html|main;"?? // text|URL|target of second sublink?
? ?
menublock[1]="Ente?genos|#|;"+? ? ? ? ? ? ? ? ? ?? // text and URL of first mainlink
? ? "Recursos generales|submenu21.html|main;"+ // text|URL|target of mainlink
? ? "Gr?ficos|submenu22.html|main;"+ // text|URL|target of first sublink
? ? "Iconos|submenu23.html|main;"+ // text|URL|target of second sublink
? ? "Im?genes|submenu24.html|main;"+ // text|URL|target of thirth sublink
? ? "Salvapantallas|submenu25.html|main;"? ?? // text|URL|target of fourth sublink
? ? ? ??
menublock[2]="Glosario de t?rminos|#|;"+? ? ? ? ? ? ? ? ? ?? // text and URL of mainlink
? ? "Hardware recursos|submenu31.html|main;"+ // text and URL of first sublink
? ? "Pc Consultas|submenu32.html|main;"+ // text and URL of second sublink
? ? "Drivers|submenu33.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Dlls|submenu34.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Empresas|submenu35.html|main;"?? // text and URL of thirth sublink
? ?
?
menublock[3]="Downloads|#|;"+? ? ? ? ? ? ? ? ? ?? // text and URL of mainlink
? ? "Trucos Office|submenu41.html|main;"+ // text and URL of first sublink
? ? "Trucos Windows|submenu42.html|main;"+ // text and URL of second sublink
? ? "Access|submenu43.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Excel|submenu44.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Unix - Linux|submenu45.html|main;"?? // text and URL of thirth sublink
menublock[4]="Links|#|;"+? ? ? ? ? ? ? ? ? ?? // text and URL of mainlink
? ? "Recursos Generales|submenu51.html|main;"+ // text and URL of first sublink
? ? "Visual Basic|submenu52.html|main;"+ // text and URL of second sublink
? ? "C++|submenu53.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Delphi|submenu54.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Javascript|submenu55.html|main;"+?? // text and URL of thirth sublink
? ? ? ? ? ?? "ASP|submenu56.html|main;"?? // text and URL of thirth sublink
? ? ? ? ? ? ? ?
menublock[5]="Games|#|;"+? ? ? ? ? ? ? ? ? ?? // text and URL of mainlink
? ? "Recursos Generales|submenu61.html|main;"+ // text and URL of first sublink
? ? "Portales Hacker|submenu62.html|main;"+ // text and URL of second sublink
? ? "Cracks|submenu63.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Descargas|submenu64.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Juegos|submenu66.html|main;"+?? // text and URL of thirth sublink
? ? ? ? ? ?? "DVD-CDR|submenu66.html|main;"?? // text and URL of thirth sublink
menublock[6]="Varios|#|;"+? ? ? ? ? ? ? ? ? ?? // text and URL of mainlink
? ? "Recursos Generales|submenu61.html|main;"+ // text and URL of first sublink
? ? "Portales Hacker|submenu62.html|main;"+ // text and URL of second sublink
? ? "Cracks|submenu63.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Descargas|submenu64.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Juegos|submenu66.html|main;"+?? // text and URL of thirth sublink
? ? ? ? ? ?? "DVD-CDR|submenu66.html|main;"?? // text and URL of thirth sublink
menublock[7]="Evoluci?n del site|#|;"+? ? ? ? ? ? ? ? ? ?? // text and URL of mainlink
? ? "Recursos Generales|submenu61.html|main;"+ // text and URL of first sublink
? ? "Portales Hacker|submenu62.html|main;"+ // text and URL of second sublink
? ? "Cracks|submenu63.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Descargas|submenu64.html|main;"+? ? ?? // text and URL of thirth sublink?
? ? "Juegos|submenu66.html|main;"+?? // text and URL of thirth sublink
? ? ? ? ? ?? "DVD-CDR|submenu66.html|main;"?? // text and URL of thirth sublink
? ? ? ? ? ? ? ? ? ? ? ? ? ??
// No need to change anything below?
//? **********************************************************************************
?
var menusplit
var urlsplit
var minusimg=new Image()
minusimg.src="_private/COMP-WEB/BOTONES/carp-abierta.gif"
var plusimg=new Image()
plusimg.src="_private/COMP-WEB/BOTONES/carp-cerrada.gif"
? ?
var showsubmenus=new Array()
for (i=0;i<=menublock.length-1;i++) {
showsubmenus[i]=-1
}
var plusminusimg=new Array()
for (i=0;i<=menublock.length-1;i++) {
plusminusimg[i]=plusimg.src
}
function openandclose(visi) {
showsubmenus[visi]=(-1)*showsubmenus[visi]
? ? var menucontent=""
? ? if (showsubmenus[visi]==1) {plusminusimg[visi]=minusimg.src}
? ? if (showsubmenus[visi]==-1) {plusminusimg[visi]=plusimg.src}
? ? menucontent+="<table>"
for (i=0;i<=menublock.length-1;i++) {
? menusplit=menublock[i].split(";")
? urlsplit=menusplit[0].split("|")
? menucontent+="<tr><td>"
? ? ? ?
? ? ?? if (menusplit[1].length==0) {
? ? ? ? ? ? menucontent+="</td>"
? ? ? ? ? ? menucontent+="<td>"
? ? ? ? ? ? menucontent+="<a href="+urlsplit[1]+" target="+urlsplit[2]+">"
? ? ? ? ? ? menucontent+=urlsplit[0]
? ? ? ? ? ? menucontent+="</a></td></tr>"
? ? ? ? ? ? plus_i++
? ? ? ? }
? ? ? ?
? ? ? ? if (menusplit[1].length!=0) {
? ? ? ? ? ? var thismainmenu=i+plus_i
? ? ? ? ? ? menucontent+="<a href='javascript:openandclose("+i+")'>"
? ? ? ? ? ? menucontent+="<img src='"+plusminusimg[i]+"' border=0></a></td>"
? ? ? ? ? ? menucontent+="<td>"
? ? ? ? ? ? menucontent+="<a href='javascript:openandclose("+i+")'>"
? ? ? ? ? ? menucontent+=urlsplit[0]
? ? ? ? ? ? menucontent+="</a></td></tr>"
??
? ? ? if (showsubmenus[i]==1) {
? ? ?? for (ii=1;ii<=menusplit.length-1;ii++) {
? ? ? ? urlsplit=menusplit[ii].split("|")
? ? ? ? ? ? ? ? ? ? menucontent+="<tr><td></td><td>"
? ? ? ? ? ? ? ? ? ? menucontent+="<a href="+urlsplit[1]+" target="+urlsplit[2]+">"
? ? ? ? ? ? ? ? ? ? menucontent+=urlsplit[0]
? ? ? ? ? ? ? ? ? ? menucontent+="</a></td></tr>"
? ? ?? }
? ? ? }
? ? ? ? }? ?
}
? ? menucontent+="</table>"
if (document.all) {
? menu.innerHTML=menucontent
}
if (document.layers) {
? document.menu.document.write(menucontent)
? document.menu.document.close()
}
}