source: extensions/ExtendedDescription/template/slider.tpl @ 18928

Last change on this file since 18928 was 17349, checked in by mistic100, 12 years ago

improving slider display when mixing landscape and portrait photos (must use elastic=true if mixing panoramas)

File size: 2.2 KB
Line 
1{combine_script id='jquery.nivo.slider' path=$EXTENDED_DESC_PATH|cat:'template/nivoslider/jquery.nivo.slider.js' require='jquery' load='footer'}
2{combine_css path=$EXTENDED_DESC_PATH|cat:'template/nivoslider/nivo-slider.css'}
3{combine_css path=$EXTENDED_DESC_PATH|cat:'template/nivoslider/dark.css'}
4
5{footer_script require='jquery.nivo.slider'}
6$("#slider{$slider_id}").nivoSlider({ldelim}
7  pauseTime: {$pauseTime},
8  animSpeed: {$pauseTime}/6,
9  effect: '{$effect}',
10  directionNav: {$directionNav},
11  controlNav: {$controlNav},
12  beforeChange: function() {ldelim}
13    if ($('#slider{$slider_id}').data('nivo:vars').currentImage.attr('src') == "")
14    {ldelim}
15      return false;
16    }
17    {if $elastic_size}
18    $("#slider{$slider_id}").css({ldelim}
19      height: 'auto',
20    });
21    {/if}
22  }
23});
24{/footer_script}
25
26{if not $elastic_size}
27{assign var=slider_min_h value=$img_size.h}
28{/if}
29
30<div class="slider-wrapper theme-default" style="width:{$img_size.w}px;{if $elastic_size}height:{math equation='x+y' x=$img_size.h y=40}px;{/if}">
31  <div id="slider{$slider_id}" class="nivoSlider" style="width:{$img_size.w}px;{if $elastic_size}height:{$img_size.h}px;{/if}">
32  {foreach from=$slider_content item=thumbnail}{strip}
33    {assign var=derivative value=$pwg->derivative($derivative_params, $thumbnail.src_image)}
34    {if !$derivative->is_cached()}
35    {combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'}
36    {combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'}
37    {/if}
38   
39    <img {if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="" data-src="{$derivative->get_url()}"{/if} alt="{$thumbnail.TN_ALT}" {$derivative->get_size_htm()} {if $show_title}title="<a href='{$thumbnail.URL}'>{$thumbnail.NAME|replace:'"':"'"}</a>"{/if}>
40   
41    {if not $elastic_size}
42    {assign var=derivative_size value=$derivative->get_size()}
43    {math assign=slider_min_h equation="min(x,y)" x=$slider_min_h y=$derivative_size[1]}
44    {/if}
45  {/strip}{/foreach}
46  </div>
47</div>
48
49{if not $elastic_size}
50{footer_script}
51$("#slider{$slider_id}").css({ldelim}
52  height: {$slider_min_h}
53});
54{/footer_script}
55{/if}
Note: See TracBrowser for help on using the repository browser.