Skip to content

Commit

Permalink
Bugfix for multiple lightboxes on one page
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 3, 2015
1 parent 0d745e8 commit 8465fc3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var lightbox = $('.gallery a').simpleLightbox(options);
| widthRatio: | 0.8 | float | Ratio of image width to screen width |
| heightRatio: | 0.9 | float | Ratio of image height to screen height |
| disableRightClick | false | bool | disable rightclick on image or not |
| disableScroll | true | bool | stop scrolling page if lightbox is openend |
| disableScroll | true | bool | stop scrolling page if lightbox is opened |

###Events
| Name | Description |
Expand Down Expand Up @@ -74,6 +74,7 @@ var gallery = $('.gallery a').simpleLightbox();
gallery.next(); // Next Image
```
### Changelog
**1.5.1 - Bugfix for multiple lightboxes on one page**
**1.5.0 - Added options for disabling rightclick and scrolling, changed default prev- and next-button text**
**1.4.6 - Option for fileExt can now be false to enable pictures like example.com/pic/200/100**
**1.4.5 - Bugfix lightbox opening does not work on mobile devices**
Expand Down
5 changes: 2 additions & 3 deletions dist/simple-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ $.fn.simpleLightbox = function( options )
animating = false;
setCaption(captionText);
});

} else {
animating = false;
setCaption(captionText);
}

}
},
setCaption = function(captiontext){
Expand All @@ -202,7 +202,6 @@ $.fn.simpleLightbox = function( options )
spinner.show();
var newIndex = index + dir;
if(animating || (newIndex < 0 || newIndex >= $(selector).length) && options.loop == false ) return;
animating = true;
index = (newIndex < 0) ? $(selector).length -1: (newIndex > $(selector).length -1) ? 0 : newIndex;
$('.sl-wrapper .sl-counter .sl-current').text(index +1);
var css = { 'opacity': 0 };
Expand Down Expand Up @@ -233,6 +232,7 @@ $.fn.simpleLightbox = function( options )
});
curImg = $();
opened = false;
animating = false;
},
handleScrollbar = function(type){
if(type == 'hide'){
Expand All @@ -249,7 +249,6 @@ $.fn.simpleLightbox = function( options )
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
$(document.body)[0].removeChild(scrollDiv);
$('body').data('padding',padding);
console.log(padding, scrollbarWidth);
if(scrollbarWidth > 0){
$('body').css({'padding-right':padding+scrollbarWidth, 'overflow':'hidden'});
}
Expand Down
2 changes: 1 addition & 1 deletion dist/simple-lightbox.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8465fc3

Please sign in to comment.