Thanks for purchasing iLightBox for WordPress. If you have any questions that are beyond the scope of this help file, you've found a bug, need new feature, or you just want me to show your website using this plugin, please feel free to email me via contact form on my profile.
To get notified about plugin updates or my new releases follow me on Twitter or become a fan of my facebook page.
iLightBox allows you to easily create the most beautiful overlay windows using the jQuery Javascript library.
By combining support for a wide range of media with gorgeous skins and a user-friendly API, iLightBox aims to push the Lightbox concept as far as possible.
There are two ways to intall iLightBox:
You can install iLightBox via the WordPress plugin uploader without unzipping the file.
ilightbox-upload.zip
file.You can also install iLightBox via FTP
ilightbox
folder (this directory is created when you unzip the file).ilightbox
folder to your wp-content/plugins
directory.Once you install the plugin, you'll get new Menu Item in the Admin Panel
That's it! iLightBox should now be ready for use.
See the jQuery documentation for more on it, this section will cover just the WordPress approach.
The easiest way to use iLightBox is by adding the attribute rel="ilightbox"
to a link.
<a href="image.jpg" rel="ilightbox">Show image</a>
There are three ways to embed iLightBox into your site - using shortcode, using php function, or bind it on elements.
Use shortcode to insert the gallery.
[ilightbox id="7" columns="4" class="custom_class"][/ilightbox]
To create an inline gallery use shortcode with some content.
[ilightbox id="7"]<b>Show Inline Gallery</b>[/ilightbox]
To insert multiple galleries.
[ilightbox ids="0,1,2,3" columns="2"][/ilightbox]
Use Gallery Shortcode to insert the gallery (Refer to Gallery Shortcode).
[gallery ids="729,732,731,720" order="DESC" orderby="ID" columns="4" size="medium" link="file"]
Use php function to insert the gallery.
<?php echo get_ilightbox( array( "id" => 7, "columns" => 4, "class" => "custom_class" ) ); ?>
OR
<?php echo do_shortcode( '[ilightbox id="7" columns="4" class="custom_class"][/ilightbox]' ); ?>
To create an inline gallery use php function with content attribute.
<?php echo get_ilightbox( array( "id" => 7 ), "<b>Show Inline Gallery</b>" ); ?>
OR
<?php echo do_shortcode('[ilightbox id="7"]<b>Show Inline Gallery</b>[/ilightbox]'); ?>
To insert multiple galleries via PHP function.
<?php echo get_ilightbox( array( "ids" => "0,1,2,3", "columns" => 2 ) ); ?>
OR
<?php echo do_shortcode( '[ilightbox ids="0,1,2,3" columns="2"][/ilightbox]' ); ?>
Attach a gallery to an event for the elements. For get more information about this option refer to jQuery Bind.
Bind button available on thumbnails when the mouse is over on them.
To attach a gallery to double click
event for the document
:
To attach a gallery to click
event for the site title link element:
Here are details about gallery options and fields.
Sets path for switching windows, the default is 'vertical'.
Sets the skin, the default is 'dark'. Available skins are: dark
, light
, parade
, smooth
, metro-black
, metro-white
and mac
.
Sets the deeplinking id. This feature only works when you directly inserted the gallery.
The position to open within the elements, defaults to 0
.
Sets the ability to infinite the group, the default is OFF
.
The random position to open within the elements, the default is OFF
.
Sets the resizing method used to keep aspect ratio within the viewport, the default is ON
.
Make lightboxes optimized for giving better experience with mobile devices, the default is ON
.
Sets the maximum viewport scale of the content, the default is 1
.
Sets the minimum viewport scale of the content, the default is 0.2
.
Bring buttons into windows, or let them be over the overlay with set to ON
, the default is OFF
.
Sets content auto recognize from web pages, the default is OFF
.
Sets the resizing method used to fit content within the fullscreen mode.
Sets the stretch resizing used to fit content within the fullscreen mode for specific content types. Possible values are: image
, video
, flash
, iframe
, inline
, ajax
and html
. The default is 'flash, video
'.
Separate them by comma.
Sets the titles of all slides will be visible or not, the default is ON
.
By turning on this option your custom optimizations for mobile devices will be apply, the default is OFF
.
By turning on this option your custom optimizations for tablet devices will be apply, the default is OFF
.
Determines whether or not clicking on the dimmed background of the page hides the iLightBox and removes the dim, the default is ON
.
Sets buttons be available or not, the default is ON
.
Sets the fullscreen button, the default is ON
.
Enable the arrow buttons, the default is OFF
.
Sets the thumbnail navigation, the default is ON
.
Sets the keyboard navigation, the default is ON
.
Sets the mousewheel navigation, the default is ON
.
Sets the swipe navigation, the default is ON
.
Sets the Left
key for keyboard navigation to moving to previous window, the default is ON
.
Sets the Right
key for keyboard navigation to moving to next window, the default is ON
.
Sets the Up
key for keyboard navigation to moving to previous window, the default is ON
.
Sets the Down
key for keyboard navigation to moving to next window, the default is ON
.
Sets the Escape
key for keyboard navigation to close iLightBox, the default is ON
.
Sets the Shift+Enter
key for keyboard navigation to enter fullscreen, the default is ON
.
Sets the opacity of the dimmed background of the page, the default is 0.85
.
Determines page X offset from browser edge, the default is 0
.
Determines page Y offset from browser edge, the default is 0
.
Determines next window X offset from browser edge, the default is 45
.
Determines next window Y offset from browser edge, the default is 0
.
Determines next window opacity, the default is 1
.
Determines next window scale, the default is 1
.
Determines previous window X offset from browser edge, the default is 45
.
Determines previous window Y offset from browser edge, the default is 0
.
Determines previous window opacity, the default is 1
.
Determines previous window scale, the default is 1
.
Sets a maximum width of the thumbnails, the default is 120
.
Sets a maximum height of the thumbnails, the default is 80
.
Sets the opacity of the thumbnails, the default is 1
.
Sets the opacity of the active window thumbnail, the default is 0.6
.
Determines whether or not showing contents with effect, the default is ON
.
Determines whether or not hiding contents with effect, the default is ON
.
Determines whether or not browser resize with effect, the default is ON
.
Sets the speed of the effect when showing contents, the default is 300
.
Sets the speed of the effect when hiding contents, the default is 300
.
Sets the reposition effect speed, the default is 200
.
Sets the speed for switching effect between windows, the default is 500
.
Sets the fade effect speed for loaded contents, the default is 180
.
Sets the fade effect speed, the default is 200
.
Determines whether or not display captions on window preview, the default is ON
.
Sets the event for showing caption, the default is 'mouseenter'
.
Sets the event for hiding caption, the default is 'mouseleave'
.
Determines whether or not display social buttons on window preview, the default is ON
.
Sets the event for showing social buttons, the default is 'mouseenter'
.
Sets the event for hiding social buttons, the default is 'mouseleave'
.
Sets the social buttons.
{ facebook: true, twitter: true, googleplus: true, reddit: true, digg: true, delicious: true }
You can customize buttons in your personal way:
{ facebook: { URL: "http://example.com/path/", text: "Share it on your Timeline" }, twitter: true }
And also you can add another custom button:
{ custom_button: { source: "http://example.com/share?url={URL}", text: "Share on Custom Button", width: 720, height: 420 } }
Enable the slideshow feature and button, the default is OFF
.
Delay between cycles in milliseconds, the default is 5000
.
Whether to pause the cycling while the mouse is hovering over the lightboxes, the default is OFF
.
When slideshow is enabled, this will start the iLightBox in paused mode, the default is ON
.
A function to call when the window changes.
function(api, position) { $(api.currentElement).css({ opacity: .5 }); alert("You've reached position " + position); }
A function to call when the content loads.
function(api, position) { alert('Event "onAfterLoad" fired for item ' + position + '.'); }
A function to call before the window changes.
function(api) { alert('Event "onBeforeChange" fired.'); }
A function to call before the content loads.
function(api, position) { alert('Event "onBeforeLoad" fired for item '+position+'.'); }
A function to call when the iLightBox enter to Fullscreen.
function() { alert('Event "onEnterFullScreen" fired.'); }
A function to call when the iLightBox exit from Fullscreen.
function() { alert('Event "onExitFullScreen" fired.'); }
A function to call when the window hides.
function() { alert('Event "onHide" fired.'); }
A function to call when the iLightBox opens.
function() { alert('Event "onOpen" fired.'); }
A function to call when the content renders.
function(api, position) { alert('Event "onRender" fired for item ' + position + '.'); }
A function to call when the window comes into view.
function(api, position) { $(api.currentElement).css({ 'background': '#C00' }); alert('Event "onShow" fired for item ' + position + '.'); }
On the right column, in this section, you can add your slides by clickig the "Add a slide" button. After adding a slide you can start customizing it.
The first field is for adding source for slide. You can upload it or select it from the media library by using the camera thumbnail beside of the field.
Sets a link to another URL for thumbnail.
Specifies the media type. Required when the type cannot be detected based on the urls file extension.
One of: image
, video
, flash
, iframe
, inline
, ajax
or html
Sets a thumbnail image for use with the thumbnail controls. Images have a thumbnail based on their source image by default, this option can be used to set an alternative. For every other type this option will have to be set to generate a thumbnail.
It possible to set an icon type to overlay the thumbnail.
The caption underneath the content.
The title above the window.
Sets the skin. Available skins are: dark
, light
, parade
, metro-black
, metro-white
and mac
.
Sets the custom class for thumbnail in gallery grid overlay.
Sets a maximum width of the content.
Sets a maximum height of the content.
Sets the resizing method used to fit content within the fullscreen mode.
Enables or disables the mousewheel navigation, the default is ON
.
Enables or disables the swipe navigation, the default is ON
.
Sets the social buttons.
{ facebook: true, twitter: true, googleplus: true, reddit: true, digg: true, delicious: true }
You can customize buttons in your personal way:
{ facebook: { URL: "http://example.com/path/", text: "Share it on your Timeline" }, twitter: true }
And also you can add another custom button:
{ custom_button: { source: "http://example.com/share?url={URL}", text: "Share on Custom Button", width: 720, height: 420 } }
Allows extra options to be set when using ajax as your media type. For get more information about this option refer to jQuery.ajax().
{ type: 'post', data: { id: 14, page: 7 } }
{ data: 'id=14&page=7' }
Allows extra options to be set when using HTML5 Video.
{ h264: '/path/video.mp4', webm: '/path/video.webm', ogg: '/path/video.ogg', poster: '/path/video-poster.jpg', controls: false, autoplay: true, preload: 'auto' }
Sets flashvars on a flash movie using key/value pairs.
{ file: 'video.mp4', autostart: true }
Sets HTML Contents when you choose HTML type.
<div class="center"> <h2> <img src="http://iprodev.com/ilightbox/assets/img/smile.gif"> It's time to upgrade. </h2> <hr> <p>iLightBox supports DOM elements created on the fly.</p> </div>
A function to call when the content loads.
function(api) { $(api.element).css({ opacity: .5 }); alert("You've reached position " + api.position); }
A function to call before the content loads.
function(api) { alert('Event "onBeforeLoad" fired for item '+api.position+'.'); }
A function to call when the content renders.
function(api) { alert('Event "onRender" fired for item '+api.position+'.'); }
A function to call when the window comes into view.
function(api) { $(api.element).css({ 'background': '#C00' }); alert('Event "onShow" fired for item '+api.position+'.'); }
Yes. Your license includes the rights to use the script on a website (commercial, personal, client), or intranet site project.
Feel free to make any modifications you need. Also feel free to blog about it and show your friends, but please do not redistribute the script with your changes.
If you get javascript error, similiar to - Object [object Object] has no method iLightBox
, so very likely you've got two or more jQuery scripts on one page, one of your plugins or theme itself is adding it incorrectly. jQuery in WordPress should be added only with wp_enqueue_script('jquery');
.
This is likely a doctype issue. This plugin requires a valid doctype and rendering in quirks mode is not supported. Make sure you are using the full doctype declaration to insure rendering in standards mode.
This abbreviated doctype renders the document in quirks mode for Internet Explorer:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
The doctype with URI renders in standards mode for all browsers:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
I recommend using the HTML5 doctype.
Upload and select the player SWF file in new slide then use this code in Flashvars
:
{ file: 'movie.mp4', image: 'preview.jpg', stretching: 'exactfit' }
Where:
movie.mp4 = URL of the movie file preview.jpg = URL of the movie preview image file
Upload and select the movie MP4 file in new slide then use this code in HTML5 Video
field:
{ webm: 'movie.webm', poster: 'poster.jpg' }
Where:
movie.webm = URL of the webm format of the movie file poster.jpg = URL of the movie poster image file
It's because iLightBox will remove the scrollbar when its opens. If you want to disable this feature you need to go to ilightbox plugin folder in your WP plugins folder and open css/src/css/ilightbox.css
file then remove below code:
.ilightbox-noscroll { overflow: hidden; }
You need to use rel="ilightbox[groupname]"
attribute. You need to use unique group name for each lightbox group. e.g.
Image 1 Image 2
Where:
IMAGE.JPG = The URL of the image file GROUPNAME = The name of grouped lightboxes
Justified Image Grid
Gallery Images.FooGallery
Gallery Images.Masonry Layout
for galleries created with iLightBox.Gallery Thumbnail Size
to galleries to set the thumbnail size for gallery grid.Use Attachment Fields
to galleries to use attachments title and caption fields as lightbox title and caption if available.Use Configuration Options
to galleries to use options from configurations page as default options for galleries.Fullscreen One Slide
option.Custom Class
option.ids
attribute for shortcode to insert multiple galleries.Mobile Optimization
option.Enable on Videos Links
option.Enable on Video Pages Links
option.Enable on Gallery Shortcode
option.$.serializeObject
is a variant of existing $.serialize
method which, instead of encoding form elements to string, converts form elements to a valid JSON object which can be used in your JavaScript application.. Here is the official site: https://github.com/hongymagic/jQuery.serializeObject.
PHP Mobile Detect
The lightweight PHP class for detecting mobile devices. Here is the official site: http://mobiledetect.net/.