Smallest jQuery script shortcut

What is the smallest jQuery plugin for Lightbox (in terms of size)? Something close to Fancybox , but less :)

+6
javascript jquery gallery lightbox
source share
5 answers

I used it once ...

http://www.digitalia.be/software/slimbox2

It is only 4K.

+2
source share

I wrote a low-level lightbox jQuery script called Nitelite : https://github.com/premasagar/nitelite (it is 1.4KB when mining and gzipped)

This is a thing that can be used on its own, or create more multifunctional plugins for photo galleries.

It was used in production on several projects:

It is an open source MIT license. Enjoy;)

+14
source share

As Yi Jiang already said, the “smallest” is completely dependent on your specific needs, if you want everything that Fancybox does, I hardly doubt that there is a way to use this plugin.

However, you can take a look at others and see if they fit your needs, you should check out this list of lightbox scripts , many of which are smaller than Fancybox, but you still have to evaluate them and see if they fit your needs.

Last but not least, you can always write your own by reading the tutorial . That is, if you want to write your own. But then again, if you have such specific needs, you should know that no one will come and write some code for you for free.

+1
source share

My approach to such problems is to find a script that satisfies my requirements, and then mercilessly hack it until it contains only what I need. Once this is achieved, I will minimize the script (leaving script compression to my server).

While we are discussing this issue, if you are looking for small scripts, mainly to reduce browser fetch time, and also make sure that the web server cache control headers and compression settings are set to good values. A good entry (regarding caching) can be found here . If you do not have the correct caching policy, then it doesn’t matter if the script is small if it is loaded from the server at each page view.

+1
source share

I would shy away from the PrettyPhoto plugin, which seems convenient. There is an ad in their demo that is suspicious (my site was redirected shortly after experimenting with it)

If you are looking for a lightbox, try to find one that has been updated to the last request. Slimbox2 and fancy box have not been updated for modern css using images to create a window, and none of them have been updated to optimize changes in the latest jquery.

0
source share

All Articles