Esto no es un blog. Es una sección que programé para ir publicando aquellas cositas que me parecen interesantes y, por cualquier motivo, quiero tener a mano. Copia lo que quieras, usa lo que quieras (pero respeta sus licencias).
Escrito por: Martín el 26-11-2008 14:06:05

Vía webintenta me entero que existe esta genialidad: s3Slider jQuery plugin es un script realmente espectacular para crear "slideshows". Tan sólo hay que echar un vistazo a la demo para darse cuenta del potencial que tiene. La implementación es realmente sencilla, sólo hay que hacer las pertinentes inclusiones -jquery.js y s3Slider.js-.
En la web del plugin podemos descargar varias versiones, una de ellas con ejemplos completos. El plugin está testado para la totalidad de los navegadores más habituales.
Enlace: s3Slider jQuery plugin
Para aplicarlo, deben seguirse estas normas:
1) Inclusión de los .JS (jquery y s3Slider)
2) El HTML (ver código html)
3) El CSS (ver código css)
4) El Javascript (ver código javascript)
Ejemplo online: ver demo
Para descargarlo: aquí!
Código XHTML
<div id="s3slider">
<ul id="s3sliderContent">
<li class="s3sliderImage">
<img src="#" />
<span>Your text comes here</span>
</li>
<li class="s3sliderImage">
<img src="#" />
<span>Your text comes here</span>
</li>
<div class="clear s3sliderImage"></div>
</ul>
</div>Código CSS
#s3slider {
width: 400px; /* important to be same as image width */
height: 300px; /* important to be same as image height */
position: relative; /* important */
overflow: hidden; /* important */
}
#s3sliderContent {
width: 400px; /* important to be same as image width or wider */
position: absolute; /* important */
top: 0; /* important */
margin-left: 0; /* important */
}
.s3sliderImage {
float: left; /* important */
position: relative; /* important */
display: none; /* important */
}
.s3sliderImage span {
position: absolute; /* important */
left: 0;
font: 10px/15px Arial, Helvetica, sans-serif;
padding: 10px 13px;
width: 374px;
background-color: #000;
filter: alpha(opacity=70); /* here you can set the opacity of box with text */
-moz-opacity: 0.7; /* here you can set the opacity of box with text */
-khtml-opacity: 0.7; /* here you can set the opacity of box with text */
opacity: 0.7; /* here you can set the opacity of box with text */
color: #fff;
display: none; /* important */
top: 0;
/*
if you put
top: 0; -> the box with text will be shown at the top of the image
if you put
bottom: 0; -> the box with text will be shown at the bottom of the image
*/
}
.clear {
clear: both;
}Código JAVASCRIPT
$(document).ready(function() {
$('#s3slider').s3Slider({
timeOut: 4000
});
});