Giter Site home page Giter Site logo

slbox's Introduction

SLBox

SLBox stands for simple lightbox. And that's what it is. There are tons of lightboxes out there for mootools, but I was missing one that supplies hooks (via events or options) for interacting with other classes. I was looking for a way to integrate ThumbsSlides with a lighbox navigation. This class was specificaly designed to interact with other classes.

Just so this will still be usable as a standalone (and also for testing), I also supplied the SLBGalery class, that takes a collection of a>img and supplies navigation controlles for it. This has been tested on FF 3.5 and IE6/8, so I'm assuming close-to-full cross browser support

How to use

Simple -

#JS
lb = new SLBox('source.to.image.png');

NOTE: all styles are on the CSS file, so obviously you're gonna need that

For SLBGalery:

#JS
var lb = new SLBGalery($$(#images a));

Options for galery will be passed to the lightbox. Events attached to it will be attached to the box. Note that the Gallery assumes the anchors' href will point to the target image for the lightbox. Also note that the Gallery provides all the API of SLBox.

Options:

  • lang: An object containing the text used for the buttons (look at source code to see what you can put there)
  • next : A function to fire when pressing the next button
  • prev : A function to fire when pressing the prev button
  • images : path to images folder
  • loader : name of loader image
  • close : name of close button image
  • useNav : should the class create the navigation buttons (default:true);

Events:

  • next : fires when the next button is clicked
  • prev : fires when the prev button is clicked
  • close : fires when the box closes
  • complete : fires when the loading

slbox's People

Stargazers

 avatar

Watchers

 avatar  avatar

slbox's Issues

Error IE 7 e 8

Hi, I found errors in the method:
image = new Image ()

Solution:
image = new Element ('img');

The reason for the problem is that the native method Image does not accept the implementation of AddEvents or Clone.

Another problem is this line:
container.getElement ('. close')
. setStyle ('background-image ', 'url (' + this.options.images +'/'+ this.options.close +'')')
. addEvent ('click', this.close.bind (this));

You didn't close the style tag with + '') '

I suggest update the code so that new users don't have same problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.