Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/03/2004, 02:45
mooguel
 
Fecha de Ingreso: diciembre-2002
Mensajes: 102
Antigüedad: 21 años, 5 meses
Puntos: 0
slide de imágenes auto-actualizable

hola a todos
tengo una galeria de imágenes con slide con el siguiente código:

<html>

<head>
<title></title>
<script LANGUAGE="JavaScript">
<!--

var myPix = new Array("g14_1.jpg","g14_2.jpg","g14_3.jpg","g14_4.j pg","g14_5.jpg","g14_6.jpg","g14_7.jpg")
var thisPic = 0
function processPrevious() {
if (document.images && thisPic > 0) {
thisPic--
document.myPicture.src=myPix[thisPic]
}
}
function processNext() {
if (document.images && thisPic < 5) {
thisPic++
document.myPicture.src=myPix[thisPic]
}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../../desnudos/galeria1/1.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="101010" LINK="#666666" VLINK="#333333" ALINK="#CCCCCC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../../flecha_fotos_f2.gif','../../flecha_fotos2_f2.gif')">
<div align="left">
<table BORDER="0" CELLPADDING="0" CELLSPACING="0" bgcolor="101010">
<tr>
<td WIDTH="" height="" align="left" valign="bottom">
<p ALIGN="left"><img SRC="g14_1.jpg" WIDTH="395" HEIGHT="395" VSPACE="0" HSPACE="0"
BORDER="0" LOOP="0" NAME="myPicture"></p></td>
</tr>
<tr>
<td height="16" align="left" valign="bottom" class="unnamed1"> <a href="javascript:processPrevious()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('flecha_fotos2','','../../flecha_fotos2_f2.gif',1);"><img name="flecha_fotos2" src="../../flecha_fotos2.gif" width="14" height="14" border="0" alt=""></a><a href="javascript:processNext()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('flecha_fotos','','../../flecha_fotos_f2.gif',1)"><img src="../../flecha_fotos.gif" alt="" name="flecha_fotos" width="14" height="14" border="0"></a><font color="#999999" size="3" face="Arial, Helvetica, sans-serif">retratos
| </font></td>
</tr>
</table>
<p class="unnamed1">&nbsp;</p>
</div>
</body>
</html>



es sencillo y funciona bien.
la cuestión es la siguiente. como veis, las imágenes van cambiando según su nombre:("g14_1.jpg","g14_2.jpg","g14_3.jpg")
lo que me gustaría conseguir es poder copiar nuevas imágenes a la carpeta de donde las toma el slide y que el slide las reconociera sin tener que añadirlas en el código. no sé, igual siguiendo una secuencia numérica de modo que lo que haga el slide es ir 'contando' foto a foto por su número independientemente de cuantas haya.
no sé si esto se puede hacer, pero me sería de gran utilidad.
muchas gracias de antemano
un saludo!!