Skip to content

Commit

Permalink
New option captionClass #81, bugfix for #82
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 23, 2017
1 parent b474c97 commit 602b383
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var lightbox = $('.gallery a').simpleLightbox(options);
| captionsData | title | string | get the caption from given attribute |
| captionPosition | 'bottom' | string | the position of the caption. Options are top, bottom or outside (note that outside can be outside the visible viewport!) |
| captionDelay | 0 | int | adds a delay before the caption shows (in ms) |
| captionClass | '' | string | add an additional class to the sl-caption |
| close | true | bool | show the close button or not |
| closeText | '×' | string | text or html for the close button |
| swipeClose | true | bool | swipe up or down to close gallery |
Expand Down Expand Up @@ -155,6 +156,7 @@ $sl-iframe-border-large: 0 none;


### Changelog
**1.12.0 - New option captionClass #81, bugfix for #82**
**1.11.1 - Merged pull request #76. Thanks to walterebert, added support for images with parameters and file extension check #59**
**1.11.0 - New option for src of image. e.g data attribute #70**
**1.10.7 - Added Bootstrap compatibility #69**
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simplelightbox",
"version": "1.11.1",
"version": "1.12.0",
"homepage": "http://andreknieriem.de/simple-lightbox",
"authors": [
"André Rinas <[email protected]> (http://andrerinas.de)"
Expand Down
6 changes: 4 additions & 2 deletions dist/simple-lightbox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
By André Rinas, www.andrerinas.de
Available for use under the MIT License
1.12.0
*/
;( function( $, window, document, undefined )
{
Expand All @@ -21,6 +22,7 @@ $.fn.simpleLightbox = function( options )
captionType: 'attr',
captionsData: 'title',
captionPosition: 'bottom',
captionClass: '',
close: true,
closeText: '×',
swipeClose: true,
Expand Down Expand Up @@ -131,7 +133,7 @@ $.fn.simpleLightbox = function( options )
counter = $('<div>').addClass('sl-counter').html('<span class="sl-current"></span>/<span class="sl-total"></span>'),
animating = false,
index = 0,
caption = $('<div>').addClass('sl-caption pos-'+options.captionPosition),
caption = $('<div>').addClass('sl-caption '+options.captionClass+' pos-'+options.captionPosition),
image = $('<div>').addClass('sl-image'),
wrapper = $('<div>').addClass('sl-wrapper').addClass(options.className),
isValidLink = function( element ){
Expand Down Expand Up @@ -552,7 +554,7 @@ $.fn.simpleLightbox = function( options )

this.refresh = function(){
this.destroy();
$(this.selector).simpleLightbox(options);
$(this).simpleLightbox(options);
};

return this;
Expand Down
Loading

0 comments on commit 602b383

Please sign in to comment.