Dexterbox is responsive, flexible, modern, creative, and at the same time very easy to use lightbox plugin.
He's doing a demonstration of your content is very spectacular.
You can use plugin Dexterbox to showcase your screens of mobile applications cases, pictures, video from youtube and others.
Dexterbox can be used to create stunning overlays that work great at any screen size, in all browsers on every device.
The uniqueness of plugin in that it have an inside generator of color themes.
All parts of this plugin: CSS and javascript codes are licensed according to the license purchased from Envato.
Read more about licensing here: http://codecanyon.net/licenses
- Plugin styles file is in the "css" folder
- Plugin scripts file is in the "js" folder
1. The style file. Used for the decoration of all the elements of a plugin. View details
2. Javascript library jQuery View details
3. The main plugin file View details
<head> ...[THIS CODE]... </head>
If you use an alternative method of HTML, the initialization is not necessary.
Plugin initialization is hidden and does not require the user of the call.
But there is "open" method, which opening lightbox with the specified options.
Usually this method is hooked to the "click" event
click to show lightbox
I'm using one CSS files dexterbox.css (css/dexterbox.css) in this plugin. It contains styles which are responsible for the correct plugin work.
To use the plugin you must import two files of javascript:
1. jQuery (js/jquery-X.X.X.min.js)
2. jquery.dexterbox.js (js/jquery.dexterbox.js)
1. jQuery is a Javascript library that greatly reduces the amount of code that you must write. If you imported this version of jQuery or any other, it is not necessary to import it for the second time
2. The main plugin code.
To add a plug-in to the site you need to walk a only 3 steps:
1. Include all the necessary files to the page of the site.
2. Place all necessary files on your server using ftp
3.1 Add HTML code
3.2 Or add Open Method
Full code of examples, see in "Usage"
Option | Default value | Datatype | Description |
---|---|---|---|
items | false | Boolean or Array | In this parameter, we send in plugin an image or video data , the path to them, title, and other additional parameres. It may take the values: false or Array See demo |
items / href | - | String | Absolute or relative path path to a large copy image See demo |
items / title | - | String | Title of image. Displayed in two places: on the side and rear of the image by performing background function See demo |
items / youtube | - | Object | Links to Youtube videos will be embedded using the Youtube <iframe> API. It may take the values: object of youtube options Sets the player parameters of a Youtube video, available options can be found in the Youtube documentation: YouTube Embedded Players and Player Parameters. See demo |
items / youtube / thumb_size | 'mqdefault' | String | Thumnail resolution can be set using the thumb_size parameter It may take the values: 'hqdefault' (480x360), 'mqdefault' (320x180), 'maxresdefault' (1280x720), 1 or 2 or 3 (120x90) See demo |
items / youtube / width | 'auto' | String | This option only truly affects youtube content, for everything else this option will translate to maxWidth. It may take the values: any integer (px), 'any integer' (px), 'any integer %' (percent relative to window width), 'any integer vw' (percent relative to window width) See demo |
startIndex | 1 | Number | Image number from which to start viewing It may take the values: any positive number |
keyboard |
|
Object | Enable or disable individual keyboard buttons or all of them when set to false. Useful for when the content requires keyboard interaction. See demo |
loop | true | Boolean | When set to true a group becomes a continuous loop, keeping navigation buttons enabled at all times. It may take the values: true or false See demo |
max_width | '100vw' | String | Sets a maximum width for the content. It may take the values: Any positive number (px), 'Any positive number' (px), 'Any positive number %' (percent to window width), 'Any positive number vw' (percent to window width) See demo |
max_height | '75vh' | String | Sets a maximum height for the content. It may take the values: Any positive number (px), 'Any positive number' (px), 'Any positive number %' (percent to window height), 'Any positive number vh' (percent to window height) See demo |
counter_show | true | Boolean | Control the display of progress counter It may take the values: false or true See demo |
counter_sep | '/' | String | Separator of progress counter It may take the values: Any string value See demo |
counter_pos | 'top-left' | String | Control a progress counter position It may take the values: 'top-left', 'bottom-right', 'bottom-left' See demo |
title_side_show | true | Boolean | Control display of side title It may take the values: false or true See demo |
title_side_pos | 'bottom-left' | String | Specifies the corner in which the title will be located. It may take the values: 'top-left', 'bottom-right', 'bottom-left' See demo |
title_back_show | true | Boolean | Shows a title when set to true, or hides it when set to false. It may take the values: false or true See demo |
close_text | 'close' | String | Specifies the name of a closing button. It may take the values: Any string value See demo |
close_text_show | true | Boolean | Shows a text when set to true, or hides it when set to false. It may take the values: false or true See demo |
ui_text_direction | 'close' | String | Text direction of the information blocks It may take the values: 'top', 'bottom', 'right' See demo |
theme_name | 'night' | String | Theme name of lightbox It may take the values: 'night', 'day', 'rainbow', 'chameleon' See demo |
developer_mode | false | Boolean | If true - plugin displays all error and hints in console It may take the values: false or true |
open(options) |
Opens the modal
|
close() |
Closes the modal This method does not accept any arguments
|
after_open(object) |
Fires after opening
|
after_change(objects) |
Fires after change
|
after_close(object) |
Fires after close
|
after_next(object) |
Fires after Next
|
after_prev(object) |
Fires after Prev
|
A single item can be shown by giving dexterbox('open') an items parameter with value as array of object with href sub-parameter:
1. JS API Method:
Show Image
Show Image
Add a title by using a title sub-parameter or data-items-title attribute:
1. JS API Method:
Show Image with title2. Alternative HTML approach (click to image):
Show Image with title
Groups can be shown by giving dexterbox('open') an array with multiple items:
1. JS API Method:
Show Group2. Alternative HTML approach (click to image):
Show Group
A function to call when dexterbox opened
The variable that is passed to the function contains an opened element object.
object.href //opened element path
object.title //opened element title
1. JS API Method
Show Callback "after_open"2. Alternative HTML approach (click to image)
Show Callback "after_open"
A function to call when dexterbox changed
The variable that is passed to the function contains old element objects[0] and new element objects[1]
objects[0].href //old element path
objects[0].title //old element title
objects[1].href //new element path
objects[1].title //new element title
1. JS API Method
Show Callback "after_change"2. Alternative HTML approach (click to image)
To call function, you can use an attribute "data-after_change". Suffice it to point it at the first element of the group
Show Callback "after_change"
A function to call when dexterbox changed using Next
object.href //new element path
object.title //new element title
1. JS API Method
Show Callback "after_next"2. Alternative HTML approach (click to image)
To call function, you can use an attribute "data-after_next". Suffice it to point it at the first element of the group
Show Callback "after_next"
A function to call when dexterbox changed using Prev
object.href //new element path
object.title //new element title
1. JS API Method
Show Callback "after_prev"2. Alternative HTML approach (click to image)
To call function, you can use an attribute "data-after_prev". Suffice it to point it at the first element of the group
Show Callback "after_prev"
A function to call when dexterbox closed
object.href //new element path
object.title //new element title
1. JS API Method
Show Callback "after_close"2. Alternative HTML approach (click to image)
To call function, you can use an attribute "data-after_close".
Show Callback "after_close"
Enable or disable individual keyboard buttons or all of them when set to false. Useful for when the content requires keyboard interaction.
1. JS API Method
Use an object to toggle different buttons.
//default
keyboard: {
left: true,
right: true,
esc: true
}
keyboard: false
Example with disabled keyboard
2. Alternative HTML approach (click to image)
To set parameter, you can use an attribute "data-keyboard".
When set to true a group becomes a continuous loop, keeping navigation buttons enabled at all times.
1. JS API Method
loop: false
loop: true //default
Example without looping
2. Alternative HTML approach (click to image)
To set parameter, you can use an attribute "data-loop".
Example without looping
Sets a maximum height for the content.
1. JS API Method
max_height: '75%'
max_height: '75vh' //default
max_height: '300px'
max_height: 300
Example with a custom limiting height
2. Alternative HTML approach (click to image)
Sets a maximum width for the content.
1. JS API Method
max_width: '100%'
max_width: '100vw' //default
max_width: '200px'
max_width: 200
Example with a custom limiting width
2. Alternative HTML approach (click to image)
Shows a position indicator when set to true, or hides it when set to false.
1. JS API Method
counter_show: true //default
counter_show: false
Example with disabled counter
2. Alternative HTML approach (click to image)
Specifies the separator.
1. JS API Method
counter_sep:'/' //default
Example with of custom separator element
2. Alternative HTML approach (click to image)
Specifies the corner in which the counter will be located.
1. JS API Method
counter_pos:'top-left' //default
counter_pos:'bottom-left'
counter_pos:'bottom-right'
Example with of custom counter position
2. Alternative HTML approach (click to image)
Shows a title when set to true, or hides it when set to false.
1. JS API Method
title_back_show:true //default
title_back_show:false
Example with disabled back title
2. Alternative HTML approach (click to image)
Shows a title when set to true, or hides it when set to false.
1. JS API Method
title_side_show:true //default
title_side_show:false
Example with disabled small title
2. Alternative HTML approach (click to image)
Specifies the corner in which the title will be located.
1. JS API Method
title_side_pos:'bottom-left' //default
title_side_pos:'bottom-right'
title_side_pos:'top-left'
Example with of custom small title position
2. Alternative HTML approach (click to image)
Specifies the name of a closing button.
1. JS API Method
close_text:'Close' //default
Example with of custom text of close button
2. Alternative HTML approach (click to image)
Shows a text when set to true, or hides it when set to false.
1. JS API Method
close_text_show:true //default
close_text_show:false
Example with disabled text of close button
2. Alternative HTML approach
Sets the text direction for UI elements.
1. JS API Method
ui_text_direction:'top' //default
ui_text_direction:'bottom'
ui_text_direction:'right'
"top" (default) direction
"bottom" direction
"right" direction
2. Alternative HTML approach
Links to Youtube videos will be embedded using the Youtube <iframe> API..
1. JS API Method
Example with Youtube video2. Alternative HTML approach (click to image)
Example with Youtube video
For Youtube <iframe> can be set options using the youtube option for "items" parameter
Thumnail resolution can be set using the thumb_size parameter
1. JS API Method
youtube: {
thumb_size:'hqdefault'
}
thumb_size: 'hqdefault' //(default - 480x360)
thumb_size: 'mqdefault' //(320x180)
thumb_size: 'maxresdefault' //(1280x720)
thumb_size: 1 //(or 2 or 3 - 120x90)
Youtube video with custom thumbnails size
2. Alternative HTML approach (click to image)
This option only truly affects youtube content, for everything else this option will translate to maxWidth.
1. JS API Method
youtube: {
width: 1280
}
width: 1280
width: '1280'
width: '50%'
width: '50vw'
Youtube video with custom width
2. Alternative HTML approach (click to image)
Sets the player parameters of a Youtube video, available options can be found in the Youtube documentation: YouTube Embedded Players and Player Parameters.
1. JS API Method
youtube: {
autohide: 1,
controls: 1,
modestbranding: 1,
rel: 0
}
Youtube video with custom thumbnails size
2. Alternative HTML approach (click to image)
In a plugin there are 2 pre-installed themes
1. JS API Method
theme_name:'night' //default
theme_name:'day'
theme_name:'rainbow' //With each new call the background color will be different
theme_name:'chameleon' //With each new call the background color will be different
View example with "day" theme
2. Alternative HTML approach
Dark theme default
1. JS API Method
View example with "night" theme2. Alternative HTML approach
Generated random gradient before opening
1. JS API Method
View example with "rainbow" theme2. Alternative HTML approach
Generated random color before change
1. JS API Method
View example with "chameleon" theme2. Alternative HTML approach
The design can be changed with just a few rules