diff --git a/pgwslider.css b/pgwslider.css index db8d477..39c3d20 100644 --- a/pgwslider.css +++ b/pgwslider.css @@ -7,7 +7,7 @@ * Released under the GNU GPLv3 license - http://opensource.org/licenses/gpl-3.0 */ .pgwSlider { - width: 100%; + width: 70%; color: #fff; } @@ -61,6 +61,30 @@ z-index: 3; } +.ps-current:hover span.ps-long-description { + opacity: 1; +} + +.pgwSlider .ps-long-description { + position: absolute; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.7); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000); + left: 0; + top: 0; + display: inline; + opacity: 0; + z-index: 2; + -webkit-transition: all 300ms ease-out; + -moz-transition: all 300ms ease-out; + transition: all 300ms ease-out; +} + +.pgwSlider .ps-long-description p { + padding: 20px; +} + ul.pgwSlider, .pgwSlider ul { float: right; diff --git a/pgwslider.js b/pgwslider.js index 90d53d7..faedd6a 100644 --- a/pgwslider.js +++ b/pgwslider.js @@ -92,7 +92,7 @@ } // Get title - var elementSpan = obj.find('span').text(); + var elementSpan = obj.find('span.pgwSlideTitle').text(); if ((typeof elementSpan != 'undefined') && (elementSpan != '') && (elementSpan != null)) { element.title = elementSpan; } else { @@ -103,8 +103,8 @@ } // Get description - var elementDescription = obj.find('img').attr('data-description'); - if ((typeof elementDescription != 'undefined') && (elementDescription != '')) { + var elementDescription = obj.find('span.pgwSlideDescription').text(); + if ((typeof elementDescription != 'undefined') && (elementDescription != '') && (elementSpan != null)) { element.description = elementDescription; } @@ -221,7 +221,7 @@ pgwSlider.plugin.removeClass(pgwSlider.config.mainClassName).addClass('ps-list'); pgwSlider.plugin.wrap('
'); pgwSlider.plugin = pgwSlider.plugin.parent(); - pgwSlider.plugin.prepend('' + elementDescription + '
'); pgwSlider.plugin.find('.ps-caption').fadeIn(pgwSlider.config.transitionDuration / 2); } else { pgwSlider.plugin.find('.ps-caption').html(elementText); + pgwSlider.plugin.find('.ps-long-description').html(elementDescription); pgwSlider.plugin.find('.ps-caption').show(); } } @@ -590,6 +601,7 @@ return false; } + if (typeof direction == 'undefined') { direction = 'left'; }