Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #31 from TeamIguana/master

added support for an HTML5 compatible attribute to define an image set
  • Loading branch information...
commit 9f8a138547fddf02b6d0869c13a0765c84eab0c2 2 parents 5b67917 + 1060089
@krewenki authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 jquery.lightbox.js
View
14 jquery.lightbox.js
@@ -138,13 +138,13 @@
if (!opts.jsonData) {
opts.imageArray = [];
// if image is NOT part of a set..
- if ((!imageObject.rel || (imageObject.rel == '')) && !opts.allSet) {
+ if ((!getImageSetOf(imageObject) || (getImageSetOf(imageObject) == '')) && !opts.allSet) {
// add single image to Lightbox.imageArray
opts.imageArray.push(new Array(imageObject.href, opts.displayTitle ? imageObject.title : ''));
} else {
// if image is part of a set..
$("a").each(function() {
- if(this.href && (this.rel == imageObject.rel)) {
+ if(this.href && (getImageSetOf(this) == getImageSetOf(imageObject))) {
opts.imageArray.push(new Array(this.href, opts.displayTitle ? this.title : ''));
}
});
@@ -443,7 +443,15 @@
function disableKeyboardNav() {
$(document).unbind('keydown');
- };
+ };
+
+ function getImageSetOf(imageObject) {
+ var set_name = imageObject.rel;
+ if (!set_name || set_name == '') {
+ set_name = $(imageObject).attr('data-lightbox-set');
+ }
+ return set_name;
+ };
};
$.fn.lightbox.parseJsonData = function(data) {

0 comments on commit 9f8a138

Please sign in to comment.
Something went wrong with that request. Please try again.