Sexy Lightbox v1

View this post in English


Nota: Este post es viejo! La nueva versión está aquí: Sexy Lightbox 2.

Sexy Lightbox es un clon, más sexy y más liviano, del clásico Lightbox. Fue construido pensando en los diseñadores webs, de fácil instalación y uso. Esta entrega trae dos versiones: una en blanco y otra en negro.

Sexy Lightbox requiere el framework Mootools 1.2

Compatibilidad: Funciona tanto en navegadores modernos, como en Internet Explorer.

Demostración

Puedes ver la demostración del script en el siguiente enlace: Ver demo.

Instalación

Sube todos los archivos de Sexy Lightbox a tu servidor. Las imágenes, el CSS y el Javascript. Si ubicas la carpeta imágenes en un directorio diferente, debes cambiar la ruta configurando la opción ‘imagesdir’ de la clase. Mas abajo se explica como hacerlo.

Descarga mootools con domready, e incluye los archivos Javascript en el header de tu página.

<script src="mootools.js" type="text/javascript"></script>
<script src="sexylightbox.js" type="text/javascript"></script>

Finalmente, agrega sexylightbox.css en el header:

<link rel="stylesheet" href="sexylightbox.css" type="text/css" media="all" />

¿Cómo se usa?

Primero debemos crear la clase, en el evento domready:

window.addEvent('domready', function() {
    new SexyLightBox();
});

Usar Sexy Lightbox es fácil, solo debes añadir la clase ‘sexylightbox’ a tus enlaces:

<a href="imagen.jpg" title="algún titulo" class="sexylightbox">Ver imagen</a>

Opcional: usa la propiedad ‘title’ si quieres mostrar una descripción para la imagen.

Esta clase puede cambiarse, con la propiedad ‘find’. Lee la sección Configuración General, para aprender como hacerlo.

Si quieres crear una galería a partir de un grupo de enlaces, debes incluir el nombre de la galería en la propiedad ‘rel’:

<a href="senorms.jpg"  class="sexylightbox" rel="galeria">Enlace 1</a>
<a href="imagen.jpg"  class="sexylightbox" rel="galeria">Enlace 2</a>
<a href="cualquiera.jpg"  class="sexylightbox" rel="galeria">Enlace 3</a>

La clase SexyLightBox es muy flexible. Lee la documentación para ver todas las opciones disponibles.

Documentación

Las siguientes opciones están disponibles para la creación de la clase:

  • OverlayStyles

    Estilo CSS para el background.

    new SexyLightBox({OverlayStyles:{'background-color':'#fff', 'opacity': 0.6}});

  • showDuration, closeDuration

    Duración (en ms) de la transición del background.

    new SexyLightBox({showDuration:200, closeDuration:400});

Estilos del Lightbox

Sexy Lightbox trae dos versiones, una en blanco y otra en negro. Por defecto, se usa el negro, pero modificando un par de opciones puedes cambiarlo al blanco.

  • color

    Admite: ‘black’ o ‘white’. Por defecto se usa ‘black’. Esta opción se utiliza para ubicar las imágenes que se usarán, en el directorio ‘sexyimages’.

    new SexyLightBox({color:'white'});

  • hexcolor

    Valor en hexadecimal para el color elegido. Por defecto se usa ‘#000000′.

    new SexyLightBox({color:'white', hexcolor:'#FFFFFF'});

  • captionColor

    Valor en hexadecimal para el color de las descripciones. Por defecto se usa ‘#FFFFFF’.

    new SexyLightBox({color:'white', hexcolor:'#FFFFFF', captionColor:'#000000'});


Configuración general

Propiedad: find
Clase a buscar en los enlaces para aplicar el lightbox. Por defecto se usa ‘sexylightbox’. Esta opción te permite crear varias instancias del lightbox y poder usar cada una en distintos enlaces.
En el siguiente ejemplo, el Enlace1 mostrará el lightbox negro, y el Enlace2 mostrará el blanco:

<script type="text/javascript">
  window.addEvent('domready', function(){
    new SexyLightBox({find:'sexylightbox'}); /* Por defecto, el color es negro */
    new SexyLightBox({find:'sexyblanquito', color:'white', hexcolor:'#FFFFFF', captionColor:'#000'});
  });
</script>

<p><a href="imagen1.jpg" class="sexylightbox">Enlace1</a></p>
<p><a href="imagen2.jpg" class="sexyblanquito">Enlace2</a></p>

Propiedad: imagesdir
Nombre del directorio que contiene las imágenes de estilo. Dentro de este directorio, se encuentran los directorios del color (black y white). Si quieres renombrar o ubicar esta carpeta en otro directorio, debes cambiar esta propiedad.

Licencia

El script es publicado bajo la licencia MIT.

Descargar

Actualización: Disponible Sexy Lightbox 2.

Sólo para propósitos históricos:
Descarga SexyLightBox.v1.zip (sin ejemplos + versión comprimida)

Descarga SexyLightBox-Example.zip (SexyLightbox.js + mootools + ejemplos)

What is really infuriating is his denial that he was attacking the Tea Party. He was “only reading a WSJ article” on the floor of the Senate. Hannity could have done a better job of hammering on THAT giant piece of brazen hypocrisy.,

Kathy, the content you have graciously shared with us every once in a while is both inspiring and entertaining. And a blog is the perfect medium for this. A lot of the content is about your style and creative personality. Thus, I would rule out the community-based ideas. I would probably only read your stuff anyway.,

Just look at the difference just 20-30 rock solid Tea Party conservatives have made in the House already. They’ve turned “1/3 of the government” on its head and started a war between the establishment party and the Tea Party.,

Just look at the difference just 20-30 rock solid Tea Party conservatives have made in the House already. They’ve turned “1/3 of the government” on its head and started a war between the establishment party and the Tea Party.,

Honestly said, I don’t think you can do anything to fend off the attacks. I don’t think you got attacked because of something you did, but because lots of people admire you and your work. That’s apparently enough for some people to hate you. Only by unpassionating your readers, can you hope to actually stop the haters. I hope you will reject that option.,

Kathy, the content you have graciously shared with us every once in a while is both inspiring and entertaining. And a blog is the perfect medium for this. A lot of the content is about your style and creative personality. Thus, I would rule out the community-based ideas. I would probably only read your stuff anyway.,

That’s fine for the House and Senate but for president, there is no way any conservative should vote for either Democrat that will be stuffed down our throats next year. The House is the grand prize. If we had someone like Jim Jordan as Speaker and more than the current 3 reliable conservative senators, the president wouldn’t matter.,

I do think that by working in a team, it will make it easier for you. The passion moves away from you and to the team of writers, the hate will move with it. Being a part of a groupblog would be a good solution.,

I always wondered if the Manchurian Candidate

It’s entirely possible that I copied that individual number across incorrectly (and that the index was correct), but when I did the query just then it returned a Technorati Rank of 37, so as you say there would be no change in the rank, but an improvement in your index.,

In doing this blog and thinking about this stuff, have you ever had any ideas for what kinds of tools (software, that is) that people could use to do things like share creative ideas in groups, create customer community, etc. etc.?,

Kayla_Iowa dice:

I think greater interaction among groups would result (mix up the tech bloggers and the marketers and the VCs and the usability people and, hell, even the sex bloggers) ;) and really spark some awesome conversations.,

What is really infuriating is his denial that he was attacking the Tea Party. He was “only reading a WSJ article” on the floor of the Senate. Hannity could have done a better job of hammering on THAT giant piece of brazen hypocrisy.,

That’s fine for the House and Senate but for president, there is no way any conservative should vote for either Democrat that will be stuffed down our throats next year. The House is the grand prize. If we had someone like Jim Jordan as Speaker and more than the current 3 reliable conservative senators, the president wouldn’t matter.,

In relation to the Technorati rank it’s pulled down via an API (geez I think that’s what it’s called) as is Alexa rank & the script calculates the index – I just need to record the figures in a spreadsheet for upload.,

Use your passion and geek expertise to liberate the latent creativity that resides in readers, something that works better than the linear, sequential and fast fading stream of comments (yeah, this is recursive). Comments are writing, but lets have something not as we know it. Writing in this box just feel a little klunky, there must be a better way, make a better blog :) ,

I hate to see us lose your input but I wonder if simply publishing articles with no comments enabled and having a members-only forum wouldn’t be a good compromise. There’s something about the immediacy of the response form and the lack of accountability available from anonymity (oh, hypocritical me) that seems to encourage people’s awfulness.,

Only reason I voted for him was SARAH. I wasn’t even going to vote until he picked her. I had voted in every election since the late 1960?s.,

Just look at the difference just 20-30 rock solid Tea Party conservatives have made in the House already. They’ve turned “1/3 of the government” on its head and started a war between the establishment party and the Tea Party.,

Only reason I voted for him was SARAH. I wasn’t even going to vote until he picked her. I had voted in every election since the late 1960?s.,

I’m not sure what you have against “The Five”. I mean, four of the five panel members are on the right. The only creep is Bob Beckel. I admit, his creepiness makes the show a bit harder to handle. But Greg Gutfeld makes up for it! I LOVE him!! Beckel will probably have a stroke or a heart attack on the show one day and they can just shove him off the stage and continue on.,

I always wondered if the Manchurian Candidate

What is really infuriating is his denial that he was attacking the Tea Party. He was “only reading a WSJ article” on the floor of the Senate. Hannity could have done a better job of hammering on THAT giant piece of brazen hypocrisy.,

Use your passion and geek expertise to liberate the latent creativity that resides in readers, something that works better than the linear, sequential and fast fading stream of comments (yeah, this is recursive). Comments are writing, but lets have something not as we know it. Writing in this box just feel a little klunky, there must be a better way, make a better blog :) ,

O.K. I give up. What is your beef with Gutfeld? I think he is hilarious! He is not a serious contributor, but is there for laughs. I like him.,

I’m not sure what you have against “The Five”. I mean, four of the five panel members are on the right. The only creep is Bob Beckel. I admit, his creepiness makes the show a bit harder to handle. But Greg Gutfeld makes up for it! I LOVE him!! Beckel will probably have a stroke or a heart attack on the show one day and they can just shove him off the stage and continue on.,

I hate to see us lose your input but I wonder if simply publishing articles with no comments enabled and having a members-only forum wouldn’t be a good compromise. There’s something about the immediacy of the response form and the lack of accountability available from anonymity (oh, hypocritical me) that seems to encourage people’s awfulness.,

Use your passion and geek expertise to liberate the latent creativity that resides in readers, something that works better than the linear, sequential and fast fading stream of comments (yeah, this is recursive). Comments are writing, but lets have something not as we know it. Writing in this box just feel a little klunky, there must be a better way, make a better blog :) ,

I see two basic options for you: Reduce visibility and do something completely different, or stay visible and continue publishing your own stuff under your own name. All the options you cite can be assigned to one of these two categories. I dearly hope you go with the second option, even though I would totally understand if you decide otherwise.,

The reality is that the establishment in the Senate HATE CCB, modest as it really is and see the new Boehner plan as an out, since they figure they will get Reid to make a compromise since it is only 22 Billion in cuts.,