source: extensions/Slimi/template/mainpage_categories.tpl @ 18917

Last change on this file since 18917 was 18917, checked in by Miklfe, 11 years ago
File size: 2.0 KB
Line 
1{define_derivative name='carousel' width='300' height='300' min_width='300'}
2
3
4{html_style}
5.jcarousel-skin-cat .jcarousel-list li{ldelim}
6        min-width:{$carousel->max_width()}px;
7{/html_style}
8
9<div id="carouselcat">
10
11<div id="wrap">
12          <ul id="carousel" class="jcarousel-skin-cat">
13
14                {foreach from=$category_thumbnails item=cat}
15
16
17                        <li>
18                                        <div class="illustration">
19                                                <a href="{$cat.URL}">
20                                                        <img src="{$pwg->derivative_url($carousel, $cat.representative.src_image)}" alt="{$cat.TN_ALT}" title="{$cat.NAME|@replace:'"':' '|@strip_tags:false} - {'display this album'|@translate}" min-width="{$carousel->max_width()}" height="{$carousel->max_height()}"/>
21                                                        <div class="CatMPdescription">
22                                                                <h3>
23                                                                        {$cat.NAME}
24                                                                        {if !empty($cat.icon_ts)}
25                                                                        <img title="{$cat.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent{if $cat.icon_ts.IS_CHILD_DATE}_by_child{/if}.png" alt="(!)">
26                                                                        {/if}
27                                                                </h3>
28                                                               
29                                                                {if isset($cat.INFO_DATES) }
30                                                                <p class="dates">{$cat.INFO_DATES}</p>
31                                                                {/if}
32                                                                <p class="Nb_images">{$cat.CAPTION_NB_IMAGES}</p>
33                                                                {if not empty($cat.DESCRIPTION)}
34                                                                <p>{$cat.DESCRIPTION}</p>
35                                                                {/if}
36                                                        </div>
37                                                </a>
38                                        </div>
39                        </li>
40                {/foreach}
41        </ul>
42{footer_script}{literal}
43function mycarousel_initCallback(carousel)
44{
45// Disable autoscrolling if the user clicks the prev or next button.
46    carousel.buttonNext.bind('click', function() {
47        carousel.startAuto(1);
48    });
49
50    carousel.buttonPrev.bind('click', function() {
51        carousel.startAuto(0);
52    });
53       
54       
55    // Pause autoscrolling if the user moves with the cursor over the clip.
56    carousel.clip.hover(function() {carousel.stopAuto();},
57                                                function() {carousel.startAuto();}
58                                                );
59};
60
61jQuery(document).ready(function() {
62    jQuery('#carousel').jcarousel({
63        auto: 1,
64                wrap: 'circular',
65                scroll: 2,
66                animation: 2000,
67                initCallback: mycarousel_initCallback,
68               
69    });
70});
71{/literal}{/footer_script}
72</div>
73</div>
74
Note: See TracBrowser for help on using the repository browser.