Skip to content

gfic_lightbox_defaults

Description

This Javascript filter can be used to override default options for the Image Choices lightbox feature

Usage

gform.addFilter( 'gfic_lightbox_defaults', function( defaults ){
    return defaults;
}, 10, 1);

Parameters

  • defaults Object
    All the default options.

Examples

This example disables right-click as a default option in the lightbox for Image Choices:

gform.addFilter( 'gfic_lightbox_options', function( defaults ){
    defaults.disableRightClick = true;
    return defaults;
}, 10, 1);

All Options

Below are all the options and their default values:

{
    sourceAttr: 'href',
    overlay: true,
    spinner: true,
    nav: true,
    navText: ['‹', '›'],
    captions: true,
    captionDelay: 0,
    captionSelector: 'self',
    captionType: 'attr',
    captionsData: 'title',
    captionPosition: 'bottom',
    captionClass: '',
    close: true,
    closeText: '×',
    swipeClose: true,
    showCounter: true,
    fileExt: 'png|jpg|jpeg|gif|webp',
    animationSlide: true,
    animationSpeed: 250,
    preloading: true,
    enableKeyboard: true,
    enableSwipe: true,
    loop: true,
    rel: false,
    docClose: true,
    swipeTolerance: 50,
    className: 'jetsloth-lightbox',
    widthRatio: 0.8,
    heightRatio: 0.9,
    scaleImageToRatio: false,
    disableRightClick: false,
    disableScroll: true,
    alertError: true,
    alertErrorMessage: 'Image not found, next image will be loaded',
    additionalHtml: false,
    history: true,
    throttleInterval: 0
}

Placement

Your code snippet can be placed in a HTML field on your form (within <script></script> tags), or in a theme custom JavaScript file, or you could use the free Gravity Forms Code Chest addon by our friends at GravityWiz.

Source Code

This filter is located in js/jetsloth-lightbox.js.