Superfast lightweight javascript gallery library

Nowadays, there are a lot of jQuery plugins for everything which causes slow down your website. Also, there are a lot of jQuery gallery libraries for image slideshows.

Which are very slow in processing your images and converting them into fancy and user-friendly galleries. For this purpose, I made a super fast and lightweight ( ~ 5kb ) javascript library for image sliding, without jQuery required.

GalleryJS is a useful javascript library for fast-creating image slideshows. There is no need to configure CSS and image paths, only load the library, and that’s it.

Images for the slideshow, you can load with HTML or pass an array of image URLs.



<div id="galleryjs">
	<img src="" alt=""/>
	<img src="" alt=""/>
	<img src="" alt=""/>
	<img src="" alt=""/>
	<img src="" alt=""/>

or init empty container and pass images from an array

<div id="galleryjs">

There are a few config parameters.

  • images – an array of images URLs
  • autoplay – true or false. If this parameter is set to true, the images will automatically change. The default value is true
  • autoplay_delay – if the previous parameter is true, you can set this parameter in milliseconds. The default value is 4000 or 4 seconds.
  • show_thumbs – true or false. If this parameter is set to true, GalleryJS will generate small clickable thumbnails
  • thumbs_type – you can choose between hover and fixed. Default is hover, which means the thumbnail bar will be shown when the user’s pointer is over the big image. The default value is hover
  • container – CSS selector for the container. Default value is #galleryjs

Basic usage;

pass images from parameter{
    'images' : [’path/to/image1.jpg’, ’path/to/image2.jpg’] });

GalleryJS with more config parameters{
    'autoplay': true, //true or false
    'autoplay_delay': 4000, 
    'show_thumbs' : true, //true or false to hide thumbanils
    'thumbs_type':'hover' //hover or fixed

Also, for navigation, you can use keyboard arrows to change images{

Source code for this library you

can find it at my github, and example at my jsfiddle

Hope this article will be useful to you!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: