Index: /extensions/Slide/js/slideshow.js =================================================================== --- /extensions/Slide/js/slideshow.js (revision 27401) +++ /extensions/Slide/js/slideshow.js (revision 27402) @@ -79,56 +79,8 @@ $('ul',ele).append($('
').addClass('img-' + i).append($('').addClass('contenerImg').width(options.width).height(cont_h).append(blockImg))); - var $block = $('.img-'+ i ,ele); - _resizeSlideshowImag($block) ; - }); - + + _resizeSlideshowImag(); - //resize and center image_____________________________________________________________________________________________________ - - function _resizeSlideshowImag ($block){ - - var $img = $block.find('img'), - $descr = $block.find('.descr'), - $img_w = $img.width(), - $img_h = $img.height(), - $img_r = $img_h/$img_w, - $box_h = cont_h, - $box_w = options.width, - $box_r = $box_h/$box_w, - $new_h, - $new_w; - - if(($img_h > $box_h) || ($img_w > $box_w)){ - if($box_r < $img_r){ - $new_h = $box_h - 30; - $new_w = $box_h / $img_r - }else{ - $new_h = ($box_w * $img_r) - 30; - $new_w = $box_w - }; - - }else{ - $new_h = $img_h; - $new_w = $img_w; - }; - var $left = ($(ele).data('e').s_w / 2)-($new_w / 2) + 'px', - $top = ($box_h / 2)-($new_h / 2) + 'px'; - - $img.css({ - width : $new_w + 'px', - height : $new_h + 'px', - left : $left, - top : $top, - }); - $descr.css( - { - left : $left, - width : $new_w + 'px', - height : $new_h/4, - bottom : (($box_h / 2)-($new_h / 2)) + 'px', - }) - // }) - }; //slide_____________________________________________________________________________________________ if(options.styleSlideshow == 'Slide'){ @@ -323,4 +275,50 @@ //___________________________________________Fonctions_____________________________________________________________________________________ +//resize and center image__________________________________________________________________________________________________________________ + + function _resizeSlideshowImag (){ + + $('ul img',ele).each(function(){ + var $img = $(this), + $descr = $(this).prev(), + $img_w = $img.width(), + $img_h = $img.height(), + $img_r = $img_h/$img_w, + $box_h = cont_h, + $box_w = options.width, + $box_r = $box_h/$box_w, + $new_h, + $new_w; + if(($img_h > $box_h) || ($img_w > $box_w)){ + if($box_r < $img_r){ + $new_h = $box_h - 30; + $new_w = $box_h / $img_r + }else{ + $new_h = ($box_w * $img_r) - 30; + $new_w = $box_w + }; + + }else{ + $new_h = $img_h; + $new_w = $img_w; + }; + var $left = ($(ele).data('e').s_w / 2)-($new_w / 2) + 'px', + $top = ($box_h / 2)-($new_h / 2) + 'px'; + + $img.css({ + width : $new_w + 'px', + height : $new_h + 'px', + left : $left, + top : $top, + }); + $descr.css( + { + left : $left, + width : $new_w + 'px', + height : $new_h/4, + bottom : (($box_h / 2)-($new_h / 2)) + 'px', + }) + }) + }; //animation________________________________________________________________________________________________________________________________ function _rotate(ele) { Index: /extensions/Slide/template/picture.tpl =================================================================== --- /extensions/Slide/template/picture.tpl (revision 27401) +++ /extensions/Slide/template/picture.tpl (revision 27402) @@ -1,5 +1,2 @@ -{* Example of resizeable -{include file='include/autosize.inc.tpl'} -*} {if isset($MENUBAR)}{$MENUBAR}{/if} @@ -24,17 +21,18 @@ {strip} - +