LC Lightbox - jQuery Plugin

Documentation

Callbacks

LC Lightbox has got also several callbacks triggered during its operations.
Callbacks have to be used right on plugin's initialization.

Here's an example showing the full callbacks list:

<script type='text/javascript'>
$(document).ready(function() {
	$obj = lc_lightbox('#lcl_elems_wrapper a', {
		option1 : 'value1',
		option2 : 'value2',
		...
		elems_parsed 	: function(opts, vars) {}, // Triggered when targeted DOM elements have been managed (indipendently from lightbox opening)
		html_is_ready 	: function(opts, vars) {}, // Triggered when lightbox's HTML code is appended to page 
		on_open			: function(opts, vars) {}, // Triggered on first lightbox opening: right BEFORE lightbox element is displayed
		on_elem_switch	: function(opts, vars, new_el_id) {}, // Triggered right before lightbox element's switch. new_el_id contains the element's index to be shown next
		slideshow_start	: function(opts, vars) {}, // Triggered on slideshow start
		slideshow_end	: function(opts, vars) {}, // Triggered on slideshow end
		on_fs_enter		: function(opts, vars) {}, // Triggered on fullscreen mode enter
		on_fs_exit		: function(opts, vars) {}, // Triggered on fullscreen mode exit
		on_close		: function(opts, vars) {}  // Triggered on lightbox closing. HTML and variables are still accessible
	});
});
</script>

There are two fixed arguments passed to these functions:

opts
Object containing managed lightbox options
vars
Object containing various objects and variables used by the lightbox instance

They are essentially equal to use global variables (check the related chapter to know more).

Let's get in touch!

Features list

  • Elements Slideshow (manually or automatically initialized)
  • Thumbnails Navigation (with customizable sizes and optional data-type icon)
  • Effective Socials Share (with WhatsApp option on mobile)
  • Element Contents (title, description and author)
  • Images "right-click" protection
  • Show and mix multiple data type (Images - HTML5 video - youtube - vimeo - dailymotion - inline HTML - iframe)
  • Natively supports webp/avif images
  • Fullscreen mode
    • Covering only browser or entire screen space
    • Optionally forced under target screen sizes
    • Fullscreen-only mode
    • Image option to cover available space (cropping it) or to be completely shown
  • Elements direct download (not requiring PHP scripts)
  • Components Toggling (thumbnails and texts).
  • Thumbnails and texts optionally hidden by default under target screen sizes
  • Dynamic Elements Tracking
  • HTML support in element descriptions
  • 100% CSS Driven
  • (optional) Mousewheel and Keyboard elements navigation
  • Touch integrations
    • Swipe > navigate through elements
    • Double-tap > zoom-in image
    • Pinch-in and out > zoom-in and out image
  • Dev-oriented and well-documented methods & Events
  • SEO deeplinking system with browser-history management
  • Progressive images zoom
  • Comments integration (Disqus or Facebook Comments)
  • 4 layouts (text over element, under element or on right/left side)
  • (optional) closing button on corner position (for inner commands)
  • (optional) navigation buttons on middle position (for inner commands)
  • 7 preset show/hide animations
  • Automatic fallback on text over image on small screens or whether element becomes too small
  • 3 preset skins to be used and mixed on a single page (light, dark and minimal)
  • Code projected to be easily skinned via CSS
  • Dual commands position (inside and outside lightbox window)
  • Specific element behaviors
    • Forced outer commands
    • Custom element width (not for images)
    • Custom element height (not for images)
    • Custom element aspect ratio combining width & height (not for images)
  • Elements complete preload once page is loaded
  • Adapts to your page's code (you set how lightbox fetches contents from binded elements)
  • Full control on each animation/effect timing
  • Modal mode
  • Thumbnails script support (eg. easily integrates with Timthumb)
  • MUCH MORE! check 60+ lightbox options