From 636a56adab2b47ef50316ebfda134bf03c1beabe Mon Sep 17 00:00:00 2001 From: Brian Hoffmann Date: Sun, 16 Oct 2016 12:50:17 +0200 Subject: [PATCH] Add options for button texts This allows custom button texts, which is useful if you want the buttons to be named in a language other than Englisch. --- nivo-lightbox.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nivo-lightbox.js b/nivo-lightbox.js index 179e27b..53aac4d 100644 --- a/nivo-lightbox.js +++ b/nivo-lightbox.js @@ -25,7 +25,10 @@ onPrev: function(element){}, beforeNext: function(element){}, onNext: function(element){}, - errorMessage: 'The requested content cannot be loaded. Please try again later.' + errorMessage: 'The requested content cannot be loaded. Please try again later.', + buttonPrev: 'Previous', + buttonNext: 'Next', + buttonClose: 'Close' }; function NivoLightbox(element, options){ @@ -325,8 +328,8 @@ var overlay = $('
', { 'class': 'nivo-lightbox-overlay nivo-lightbox-theme-'+ this.options.theme +' nivo-lightbox-effect-'+ this.options.effect }); var wrap = $('
', { 'class': 'nivo-lightbox-wrap' }); var content = $('
', { 'class': 'nivo-lightbox-content' }); - var nav = $('PreviousNext'); - var close = $('Close'); + var nav = $(''+ this.options.buttonPrev +''+ this.options.buttonNext +''); + var close = $(''+ this.options.buttonClose +''); var title = $('
', { 'class': 'nivo-lightbox-title-wrap' }); var isMSIE = /*@cc_on!@*/0;