Este blog está libre de NOFOLLOW!

s3Slider – Slideshow con JQuery

en Desarrollo web, Diseño web, JQuery, Javascript / Marzo 19, 2009 / 1 Comentario

s3Slider JQuery Plugin, con el que podemos crear atractivos slideshows con imágenes y texto. Es de uso muy sencillo, ideal para principiantes. Antes de adentrarte en la explicación podés ver un ejemplo.

Uso:

Descargar JQuery desde su página oficial, luego incluir la líbrería y el Javascript de s3Slider en el header de la página donde vamos a usarlo.

<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/s3Slider.js" type="text/javascript"></script>

HTML

<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>

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;
}

Luego inicializamos s3Slider y configuramos el tiempo en milisegundos que se mostrará cada imagen del slideshow

$(document).ready(function() {
$('#s3slider').s3Slider({
timeOut: 4000
});
});

Funciona en:

  • Firefox 2.x
  • Firefox 3.0.3
  • Opera 9.6
  • Safari 3.0.3
  • Google Chrome
  • Internet Explorer 6 y 7

EjemploDescarga (comprimida)Descarga (no comprimida)Descarga (con ejemplo)


Un comentario en “s3Slider – Slideshow con JQuery”

  • Bitacoras.com Dijo:

    Información Bitacoras.com…

    Valora en Bitacoras.com: s3Slider JQuery Plugin, con el que podemos crear atractivos slideshows con imágenes y texto. Es de uso muy sencillo, ideal para principiantes. Antes de adentrarte en la explicación podés ver un ejemplo. Uso: Descargar JQuery…


Comentar

XHTML: Puedes usar los siguientes tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">