Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added option to display download link below image caption.

  • Loading branch information...
commit 882701dc942d108abc068c54da763d21783d7399 1 parent 719c6e7
@mscottford mscottford authored committed
Showing with 16 additions and 8 deletions.
  1. +1 −0  css/lightbox.css
  2. +2 −1  index.html
  3. +13 −7 jquery.lightbox.js
View
1  css/lightbox.css
@@ -86,6 +86,7 @@ padding-right: 20px;
#imageData #imageDetails{ width: 70%; float: left; text-align: left; }
#imageData #caption{ font-weight: bold; }
#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em; }
+#imageData #numberDisplay a { color: black; padding-left: 5px; padding-right: 5px;}
#imageData #bottomNavClose{ width: 66px; float: right; padding-bottom: 0.7em; }
#imageData #helpDisplay {clear: left; float: left; display: block; }
View
3  index.html
@@ -22,7 +22,8 @@
fitToScreen: true,
scaleImages: true,
xScale: 1.2,
- yScale: 1.2
+ yScale: 1.2,
+ displayDownloadLink: true
});
$(".lightbox-json").lightbox({
View
20 jquery.lightbox.js
@@ -233,10 +233,10 @@
};
function end() {
- disableKeyboardNav();
- $('#lightbox').hide();
- $('#overlay').fadeOut();
- $('select, object, embed').show();
+ disableKeyboardNav();
+ $('#lightbox').hide();
+ $('#overlay').fadeOut();
+ $('select, object, embed').show();
};
function preloadNeighborImages() {
@@ -313,6 +313,10 @@
var nav_html;
nav_html = opts.strings.image + (opts.activeImage + 1) + opts.strings.of + opts.imageArray.length;
+
+ if (opts.displayDownloadLink) {
+ nav_html += "<a href='" + opts.imageArray[opts.activeImage][0] + "'>" + opts.strings.download + "</a>";
+ }
if (!opts.disableNavbarLinks) {
// display previous / next text links
@@ -324,8 +328,8 @@
nav_html += '<a title="' + opts.strings.nextLinkTitle + '" href="#" id="nextLinkText">' + opts.strings.nextLinkText + "</a>";
}
}
-
- $('#numberDisplay').html(nav_html).show();
+
+ $('#numberDisplay').html(nav_html).show();
}
if (opts.slideNavBar) {
@@ -447,6 +451,7 @@
yScale: 1,
displayTitle: true,
navbarOnTop: false,
+ displayDownloadLink: false,
// slide nav bar up/down between image resizing transitions
slideNavBar: false,
@@ -461,7 +466,8 @@
nextLinkText: 'Next &raquo;',
closeTitle: 'close image gallery',
image: 'Image ',
- of: ' of '
+ of: ' of ',
+ download: 'Download'
},
// resize images if they are bigger than window
Please sign in to comment.
Something went wrong with that request. Please try again.