From 2835f5c4c62dd61211323a28b6af25f7d72b5075 Mon Sep 17 00:00:00 2001 From: Tino Brackebusch Date: Wed, 10 Dec 2014 19:27:11 +0100 Subject: [PATCH 1/2] Fix opacity issue with caption container When changing the caption containers opacity this will directly impact the opacity of the content as well, which may not be desired behavior (in my case). To allow for independent changes to the background color opacity two more elements are required as usually with modal dialogs. This PR adds these elements - one for the backdrop and one for the caption text allowing to access and style it. --- jquery.nivo.slider.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jquery.nivo.slider.js b/jquery.nivo.slider.js index 8b0a774..ec1a51e 100644 --- a/jquery.nivo.slider.js +++ b/jquery.nivo.slider.js @@ -87,12 +87,12 @@ $('.nivo-box').remove(); }); - //Create caption - slider.append($('
')); + // Create caption + slider.append($('
')); // Process caption function var processCaption = function(settings){ - var nivoCaption = $('.nivo-caption', slider); + var nivoCaption = $('.nivo-caption-text', slider); if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){ var title = vars.currentImage.attr('title'); if(title.substr(0,1) == '#') title = $(title).html(); @@ -659,4 +659,4 @@ $.fn._reverse = [].reverse; -})(jQuery); \ No newline at end of file +})(jQuery); From c035daadbece6f6d193840bb3c4184a8d60efa20 Mon Sep 17 00:00:00 2001 From: Tino Brackebusch Date: Wed, 10 Dec 2014 19:31:19 +0100 Subject: [PATCH 2/2] Update nivo-slider.css Changes to base stylesheet required to style the caption opacity independently. --- nivo-slider.css | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/nivo-slider.css b/nivo-slider.css index d806fef..cf464c2 100644 --- a/nivo-slider.css +++ b/nivo-slider.css @@ -63,20 +63,29 @@ position:absolute; left:0px; bottom:0px; - background:#000; color:#fff; width:100%; z-index:8; - padding: 5px 10px; - opacity: 0.8; overflow: hidden; - display: none; - -moz-opacity: 0.8; - filter:alpha(opacity=8); -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box; /* Opera/IE 8+ */ } +.nivo-caption .backdrop { + position: absolute; + background: #000; + bottom: 0; + height: 100%; + -moz-opacity: 0.8; + opacity: .8; + filter: alpha(opacity=8); + width: 100%; +} +.nivo-caption .nivo-caption-text { + display: none; + position: relative; + padding: 5px 10px; +} .nivo-caption p { padding:5px; margin:0; @@ -110,4 +119,4 @@ } .nivo-controlNav a.active { font-weight:bold; -} \ No newline at end of file +}