Jason Butz

Passionate about the web; enjoys JavaScript more than is probably reasonable; loves learning new things; Sr. Software Engineer @ Genesys

Bootstrap Lightbox Update

May 03, 2013 in #JavaScript #Bootstrap

I took a bit of a break from working on Bootstrap Lightbox. I just needed to get away and be lazy for a while, but I am back. The other week I re-wrote the whole thing again. I'm sure that gets tiring for some, but I had several reasons:

  • I wanted to do a little as necessary as Twitter updates Bootstrap
  • I wanted Bootstrap Lightbox to focus on images
  • I needed more JavaScript practice

So, here is what is going on. The modal JavaScript is now a dependency. I take its functions and extend them and only modify the ones for lightbox that need it. This reduced the amount of work required significantly. If people want to extend or tweak Bootstrap Lightbox to use with non-image content or with carousels then they are welcome to do so, but that isn't what Bootstrap Lightbox is for. I'm focusing on images and that makes the code much easier to work with. This will make it a lot easier to add in some image gallery functionality. The old JavaScript was a mess, but now it is a lot cleaner and easier to understand.

So, what do I plan to do next? I am thinking about adding a feature so that you don't need to add any extra HTML to your page. The feature would be optional, but it would provide a good basis to take care of image galleries.

The new version is still a work in progress, but I think I have it all working. It should be released soon.

Share on Google+