Powerful jQuery Responsive Image Gallery Plugin - Blueimp Gallery

Powerful jQuery Responsive Image Gallery Plugin - Blueimp Gallery
File Size: 177 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

jQuery Blueimp Gallery is a powerful and multi-functional jQuery plugin for creating responsive, touch-friendly and fully configurable image/video gallery, carousel slider and lightbox gallery.

Features:

  • Swipe, mouse and keyboard navigation
  • Cool transition effects
  • Full screen gallery
  • Infinite Carousel slider
  • Slideshow functionality supported
  • Supports youtube and vimeo videos

Basic Usage:

1. Load the jQuery Blueimp Gallery’s stylesheet file

<link rel="stylesheet" href="css/blueimp-gallery.css">

2. Create a inline carousel image gallery, which can be positioned anywhere on the page

<div id="blueimp-image-carousel" class="blueimp-gallery blueimp-gallery-carousel">
<div class="slides"></div>
<h3 class="title"></h3>
<a class="prev">‹</a> <a class="next">›</a> <a class="play-pause"></a> </div>

3. Load the latest version of jQuery from a CDN

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> 

4. The javascript

<script>
blueimp.Gallery(
    document.getElementById('links').getElementsByTagName('a'),
    {
        container: '#blueimp-gallery-carousel',
        carousel: true
    }
);
</script>

5. All the options

var options = {
    // The Id, element or querySelector of the gallery widget:
    container: '#blueimp-gallery',
    // The tag name, Id, element or querySelector of the slides container:
    slidesContainer: 'div',
    // The tag name, Id, element or querySelector of the title element:
    titleElement: 'h3',
    // The tag name, Id, element or querySelector of the indicator container:
    indicatorContainer: 'ol',
    // The class to add when the gallery is visible:
    displayClass: 'blueimp-gallery-display',
    // The class to add when the gallery controls are visible:
    controlsClass: 'blueimp-gallery-controls',
    // The class to add when the gallery only displays one element:
    singleClass: 'blueimp-gallery-single',
    // The class to add when the left edge has been reached:
    leftEdgeClass: 'blueimp-gallery-left',
    // The class to add when the right edge has been reached:
    rightEdgeClass: 'blueimp-gallery-right',
    // The class to add when the automatic slideshow is active:
    playingClass: 'blueimp-gallery-playing',
    // The class for all slides:
    slideClass: 'slide',
    // The slide class for loading elements:
    slideLoadingClass: 'slide-loading',
    // The slide class for elements that failed to load:
    slideErrorClass: 'slide-error',
    // The class for the content element loaded into each slide:
    slideContentClass: 'slide-content',
    // The class for video content elements:
    videoContentClass: 'video-content',
    // The class for video when it is loading:
    videoLoadingClass: 'video-loading',
    // The class for video when it is playing:
    videoPlayingClass: 'video-playing',
    // The class for the "toggle" control:
    toggleClass: 'toggle',
    // The class for the "prev" control:
    prevClass: 'prev',
    // The class for the "next" control:
    nextClass: 'next',
    // The class for the "close" control:
    closeClass: 'close',
    // The class for the "play-pause" toggle control:
    playPauseClass: 'play-pause',
    // The class for the active indicator:
    activeClass: 'active',
    // The list object property (or data attribute) with the object type:
    typeProperty: 'type',
    // The list object property (or data attribute) with the object title:
    titleProperty: 'title',
    // The list object property (or data attribute) with the object URL:
    urlProperty: 'href',
    // The list object property (or data attribute) with the thumbnail URL,
    // used as alternative to a thumbnail child element:
    thumbnailProperty: 'thumbnail',
    // The list object property (or data attribute) for the video poster URL:
    videoPosterProperty: 'poster',
    // The list object property (or data attribute) for the video sources array:
    videoSourcesProperty: 'sources',
    // Defines if the gallery indicators should display a thumbnail:
    thumbnailIndicators: true,
    // Defines if the gallery slides are cleared from the gallery modal,
    // or reused for the next gallery initialization:
    clearSlides: true,
    // Defines if the gallery should open in fullscreen mode:
    fullScreen: false,
    // Defines if images should be stretched to fill the available space,
    // while maintaining their aspect ratio (will only be enabled for browsers
    // supporting background-size="contain", which excludes IE < 9):
    stretchImages: false,
    // Toggle the controls on pressing the Return key:
    toggleControlsOnReturn: true,
    // Toggle the automatic slideshow interval on pressing the Space key:
    toggleSlideshowOnSpace: true,
    // Navigate the gallery by pressing left and right on the keyboard:
    enableKeyboardNavigation: true,
    // Close the gallery on pressing the ESC key:
    closeOnEscape: true,
    // Close the gallery when clicking on an empty slide area:
    closeOnSlideClick: true,
    // Close the gallery by swiping up or down:
    closeOnSwipeUpOrDown: true,
    // Emulate touch events on mouse-pointer devices such as desktop browsers:
    emulateTouchEvents: true,
    // Hide the page scrollbars: 
    hidePageScrollbars: true,
    // Stops any touches on the container from scrolling the page:
    disableScroll: true,
    // Carousel mode (shortcut for carousel specific options):
    carousel: false,
    // Allow continuous navigation, moving from last to first
    // and from first to last slide:
    continuous: true,
    // Start with the automatic slideshow:
    startSlideshow: false,
    // Delay in milliseconds between slides for the automatic slideshow:
    slideshowInterval: 5000,
    // The starting index as integer.
    // Can also be an object of the given list,
    // or an equal object with the same url property:
    index: 0,
    // The number of elements to load around the current index:
    preloadRange: 2,
    // The transition speed between slide changes in milliseconds:
    transitionSpeed: 400,
    // The transition speed for automatic slide changes, set to an integer
    // greater 0 to override the default transition speed:
    slideshowTransitionSpeed: undefined,
    // Callback function executed on slide change.
    // Is called with the gallery instance as "this" object and the
    // current index and slide as arguments:
    onslide: undefined,
    // Callback function executed after the slide change transition.
    // Is called with the gallery instance as "this" object and the
    // current index and slide as arguments:
    onslideend: undefined,
    // Callback function executed on slide content load.
    // Is called with the gallery instance as "this" object and the
    // slide index and slide element as arguments:
    onslidecomplete: undefined,
    // Callback function executed when the Gallery is closed.
    // Is called with the gallery instance as "this" object:
    onclose: undefined
};

Change log:

v2.18.1 (2016-02-22)

  • Automatically infer the url (and poster for YT) from the YouTube/Vimeo video ID.

v2.15.0 (2014-04-20)

  • Automatically infer the url (and poster for YT) from the YouTube/Vimeo video ID.

v2.14.0 (2014-02-26)

  • Has the ability to log Gallery initialization issues to the browser console.

v2.13.2 (2014-02-19)

  • Exit FullScreen mode directly on close, as Firefox prevents asynchronous API access. 

v2.13.1 (2014-02-14)

  • Added wmode

v2.12.5 (2013-12-28)

  • Added wmode

v2.12.4 (2013-12-13)

  • Fixed vertical viewport scrolling on IE for touch devices.
  • Make it easier to configure slide click events via classes.

v2.12.1 (2013-11-13)

  • Display HTML5 video with 100% width & height.

v2.11.3 (2013-10-31)

  • Added cover mode for the stretchImages option.

v2.11.2 (2013-10-19)

  • No ".js" extension for module dependencies.

v2.11.1 (2013-10-18)

  • Added hover states for the controls.

v2.10.1 (2013-10-12)

  • Adjust the carousel height based on the carousel width.

v2.10.2 (2013-10-04)

  • Added YouTube and Vimeo player plugins.
  • Added cover mode for the stretchImages option.
  • Adjust the carousel height based on the carousel width.

v2.9.0 (2013-09-20)

  • Added onopened and onclosed event callback options.

v2.8.1 (2013-09-13)

  • Bind the click handler to the document node to allow including the jQuery plugin in the document head.

v2.7.4 (2013-08-31)

  • Fixed an error in the browser support function when the Gallery script is included in the document head.

v2.7.3 (2013-08-09)

  • Enforce content-box box-sizing for the navigation and indicators.

v2.7.1 (2013-08-01)

  • Fixed touch event compatibility with jQuery.

v2.7.0 (2013-07-23)

  • Added event and onopen callback options.

v2.6.1 (2013-07-17)

  • Fixed slide class test if options clearSlides it set to true.
  • Added option unloadElements (default: true), to remove elements outside of the preload range from the DOM.

v2.5.0 (2013-07-16)

  • Moved helper functions and fullscreen, indicator and video functionality into separate source files.

 


This awesome jQuery plugin is developed by blueimp. For more Advanced Usages, please check the demo page or visit the official website.