Responsive JavaScript Image Gallery Plugin – Galleria

Looking for a affordable website?

GET STARTED
www.codingexpertz.com
Responsive JavaScript Image Gallery Plugin – Galleria

File Size: 6931KB

Total Views: 1705

Date Created:

Last Modified Date:

Official Website: Go to website

License: MIT

Galleria is a simple and various types of themes oriented image gallery and lightbox plugin. Without any knowledge programming language, you can create a beautiful image gallery with this plugin.

Features:

  • It can be installed with NPM and Bower.
  • Very easy to implement and configure.
  • No programming or coding skills are required.
  • iPhone, iPad & touch support
  • Supports Flickr, Vimeo, YouTube and more.

Install with NPM

$ npm install galleria

Install with Bower

$ bower install galleria

How to use it:

1. Include the Javascript galleria.min.js at the bottom of the web page.

<script src="path/to/js/galleria.min.js"></script>

2. Add the basic HTML to the page.

<div id="galleria-azur" class="galleria">
   <img src="path/to/demo-1.jpg" alt=""/>
   <img src="path/to/demo-2.jpg" alt=""/>
   <img src="path/to/demo-3.jpg" alt=""/>
   <img src="path/to/demo-4.jpg" alt=""/>
</div>

3. Initialize the plugin and we’re ready to go.

(function() {
    Galleria.loadTheme('js/themes/azur/galleria.azur.min.js');
    Galleria.run('#galleria-azur', {
      transition: 'fadeslide'
    });
}());

*** Don’t forget to add Galleria.loadTheme, without theme the plugin will not work. You can find this in galleria-master\dist\themes. There are total 6 predefined themes within separate folder(azur, classic, folio, fullscreen, miniml and twelve).

*** Also you will need to mention fixed height for the gallery, it will not work without height, you can add height through CSS or height option in the plugin.

.galleria{ height: 500px; }
(function() {
    Galleria.loadTheme('js/themes/azur/galleria.azur.min.js');
    Galleria.run('#galleria-azur', {
      transition: 'fadeslide',
      height: 500
    });
}());

Plugin’s default options:

Option Type Default value Description
autoplay Boolean or Number false Sets Galleria to play slidehow when initialized.
carousel Boolean true Toggle the creation of a carousel.
carouselSpeed Number 200 Carousel animation speed in milliseconds.
carouselSteps Number or String auto Defines how many “steps” the carousel should take on each nav click.
clicknext Boolean false Helper for adding a click event on the entire stage to move forward.
dailymotion Object foreground: ‘%23EEEEEE’,
highlight: ‘%235BCEC5’,
background: ‘%23222222’,
logo: 0,
hideInfos: 1
Adds player options for the Daliymotion video player
dataConfig( [HTML element] ) Function image: the src attribute OR parent <a> tag’s href attribute (if exists and links to an image)
thumb: the src attribute
title: the title attribute
description: the alt attribute
link: the longdsesc attribute
Defines how Galleria should parse the HTML. Useful for adding custom HTML captions.
dataSelector String img Defines the selector Galleria should look for in the source.
dataSort Function or String false Function to sort the data before using it.
dataSource String or Array jQuery target Defines the Galleria data, or the HTML source where the data is found.
debug Boolean true Set this to false to prevent debug messages.
dummy String undefined Defines a dummy image that will be used if the image can’t be found.
easing String galleria Defines the easing mode globally.
extend( [ options ] ) Function options Object Add custom functionality to the gallery.
fullscreenCrop Boolean undefined Sets how Galleria should crop when in fullscreen mode.
fullscreenDoubleTap Boolean true Enabled fullscreen toggle on double-tap for touch devices.
fullscreenTransition String undefined Defines a different transition for fullscreen mode.
height Number 0 Manually set a gallery height.
idleMode Boolean or String true Option for turning on/off idle mode.
idleTime Number 3000 Defines how long delay before Galleria goes into idle mode.
idleSpeed Number 200 Defines the animation speed in milliseconds when entering/exiting idle mode.
imageCrop Boolean or String false Defines how Galleria will crop the image.
imageMargin Number 0 Sets a margin between the image and the stage.
imagePan Boolean false Toggles the image pan effect.
imagePanSmoothness Number 12 Defines how smooth ( and CPU consuming ) the pan effect should be.
imagePosition String center’ Positions the image.
imageTimeout Number 30000 Sets a timeout for fetching images.
initialTransition String undefined Sets a different transition on the the first image.
keepSource Boolean false Lets you keep the source elements.
layerFollow Boolean true Boolean for controlling if the layer will follow the image size or not.
lightbox Boolean false Helper for attaching a lightbox (to zoom in) when the user clicks on an image.
lightboxFadeSpeed Number 200 Defines how fast the lightbox should fade.
lightboxTransitionSpeed Number 300 Defines how fast the lightbox should animate.
maxScaleRatio Number undefined Defines how much Galleria is allowed to upscale images.
maxVideoSize Number undefined Defines how much Galleria is allowed to upscale videos.
overlayBackground String #0b0b0b Defines the background color of the overlay.
overlayOpacity Number 0.85 Sets how transparent the overlay should be.
pauseOnInteraction Boolean true Toggles if Galleria should stop playing if the user navigates.
popupLinks Boolean false Open Image links in new windows.
preload String or Number 2 Defines how much Galleria should preload.
queue Boolean true Defines if Galleria should queue the slideshow.
responsive Boolean true Sets Galleria in responsive mode.
show Number 0 Lets you start the slideshow at any image index.
showCounter Boolean true Toggles the counter.
showInfo Boolean true Toggles the caption.
showImagenav Boolean true Toggles the image navigation arrows.
swipe String ‘auto’ Enables the swipe gesture for navigating on touch devices.
thumbCrop Boolean or String true Same as image_crop for thumbnails.
thumbDisplayOrder Boolean true Defines if the gallery should display the loaded thumbnails in order
thumbMargin Number 0 Same as imageMargin but for thumbnails.
imageMargin Number 0 Since images are scaled to fit the stage container, there might be occations when you need to apply a margin between the image and stage border. This is what this option is for.
thumbnails Boolean or String true Sets how and if thumbnails should be created.
thumbPosition String center’ Positions the thumbnail image inside it’s container. Works like the CSS background-position property, f.ex ‘top right’ or ‘20% 100%’. You can use keywords, percents or pixels. The first value is the horizontal position and the second is the vertical.
imagePosition String ‘center’ Positions the main image inside the stage container. Works like the CSS background-position property, f.ex ‘top right’ or ‘20% 100%’. You can use keywords, percents or pixels. The first value is the horizontal position and the second is the vertical.
thumbQuality Boolean or String true Defines if and how IE should use bicubic image rendering for thumbnails
touchTransition String undefined Defines a different transition when a touch device is detected.
transition String ‘fade’ Defines what transition to use.
transitionSpeed Number 400 Defines the speed of the transition.
trueFullscreen Boolean true Makes Galleria enter a native fullscreen mode where supported.
variation String ‘’ Visual variations of a theme
videoPoster Boolean true Defines if a poster image should be used for videos
vimeo Object Sets options for the Vimeo player
wait Number or Boolean 500 Defines if and how Galleria should wait until it can be displayed using user interaction.
width Number or String ‘auto’ Manually set a gallery width.
youtube Object Sets options for the YouTube player

Leave a comment

Your email address will not be published. Required fields are marked *

STAYUPDATED

Receive all our future posts instantly in your inbox. Enter your email to enroll.