<script LANGUAGE="JavaScript">
// slider wbc /with button control
// javascriptfacil · www.javascriptfacil.com
var myPix = new Array("000.gif"," 013.jpg","015.jpg","019.jpg","025.jpg","031.jpg","033.jpg","035.jpg","041.jpg","045.jpg","049.jpg")
var thisPic = 0
function processPrevious() {
if (document.images && thisPic > 0) {
thisPic--
document.myPicture.src=myPix[thisPic]
}
}
function processNext() {
if (document.images && thisPic < 10) {
thisPic++
document.myPicture.src=myPix[thisPic]
}
}</script>
// slider wbc /with button control
// javascriptfacil · www.javascriptfacil.com
var myPix = new Array("000.gif"," 013.jpg","015.jpg","019.jpg","025.jpg","031.jpg","033.jpg","035.jpg","041.jpg","045.jpg","049.jpg")
var thisPic = 0
function processPrevious() {
if (document.images && thisPic > 0) {
thisPic--
document.myPicture.src=myPix[thisPic]
}
}
function processNext() {
if (document.images && thisPic < 10) {
thisPic++
document.myPicture.src=myPix[thisPic]
}
}</script>
Este script podemos introducirlo en la propia pagina que lo va a utilizar o en un fichero externo.
<table WIDTH="600" CELLPADDING="1" CELLSPACING="0" BORDER="0">
<tr>
<td WIDTH="100%" BGCOLOR="#FFC082" VALIGN="TOP"><div align="center"><center><table
WIDTH="100%" CELLPADDING="6" CELLSPACING="0" BORDER="0">
<tr>
<td WIDTH="100%" bgColor=#8BB7E2 VALIGN="TOP"><p ALIGN="CENTER"> </p>
<p ALIGN="CENTER">
<p ALIGN="CENTER"><font FACE="Arial"><b>
</tr>
</table>
</center></div></td>
</tr>
</table>
<tr>
<td WIDTH="100%" BGCOLOR="#FFC082" VALIGN="TOP"><div align="center"><center><table
WIDTH="100%" CELLPADDING="6" CELLSPACING="0" BORDER="0">
<tr>
<td WIDTH="100%" bgColor=#8BB7E2 VALIGN="TOP"><p ALIGN="CENTER"> </p>
<p ALIGN="CENTER">
<img src="000.gif" width="300" height="225" VSPACE="0" HSPACE="0" BORDER="0" LOOP="0" NAME="myPicture"></p>
<p ALIGN="CENTER"><font FACE="Arial"><b>
<a HREF="javascript:processPrevious()"><<Anterior</a> |
<a HREF="javascript:processNext()">Siguiente>></a></b></font></p>
<p ALIGN="CENTER"> </td><a HREF="javascript:processNext()">Siguiente>></a></b></font></p>
</tr>
</table>
</center></div></td>
</tr>
</table>
El código coloreado es el más importante y es el que hay que tener cuidado para no estropear el script.