Ignore:
Timestamp:
Dec 17, 2013, 11:25:38 PM (10 years ago)
Author:
Miklfe
Message:
 
Location:
extensions/Slimi/template
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Slimi/template/index.tpl

    r18812 r25998  
    145145
    146146{if !empty($THUMBNAILS)}
    147 <ul class="thumbnails" id="thumbnails">
    148147{$THUMBNAILS}
    149 </ul>
     148{footer_script}{literal}
     149        $('.jcarousel')
     150            .jcarousel({
     151                 wrap: 'circular'
     152            })         
     153                        .jcarouselAutoscroll({
     154                        autostart: false
     155                        });     
     156                       
     157        $('.jcarousel-control-prev')
     158            .on('jcarouselcontrol:active', function() {
     159                $(this).removeClass('inactive');
     160            })
     161            .on('jcarouselcontrol:inactive', function() {
     162                $(this).addClass('inactive');
     163            })
     164            .jcarouselControl({
     165                target: '-=1'
     166            });
     167
     168        $('.jcarousel-control-next')
     169            .on('jcarouselcontrol:active', function() {
     170                $(this).removeClass('inactive');
     171            })
     172            .on('jcarouselcontrol:inactive', function() {
     173                $(this).addClass('inactive');
     174            })
     175            .jcarouselControl({
     176                target: '+=1'
     177            });
     178{/literal}{/footer_script}
    150179{/if}
    151180
    152181{if empty($THUMBNAILS)}
    153 {if !empty($CATEGORIES)}{$CATEGORIES}{/if}
     182{if !empty($CATEGORIES)}{$CATEGORIES}
     183                {footer_script}{literal}
     184        $('.jcarousel')
     185            .jcarousel({
     186                 wrap: 'circular'
     187            })         
     188                        .jcarouselAutoscroll({
     189                        interval: 3000,
     190                        target: '+=1',
     191                        autostart: true
     192                        });     
     193                       
     194        $('.jcarousel-control-prev')
     195            .on('jcarouselcontrol:active', function() {
     196                $(this).removeClass('inactive');
     197            })
     198            .on('jcarouselcontrol:inactive', function() {
     199                $(this).addClass('inactive');
     200            })
     201            .jcarouselControl({
     202                target: '-=1'
     203            });
     204
     205        $('.jcarousel-control-next')
     206            .on('jcarouselcontrol:active', function() {
     207                $(this).removeClass('inactive');
     208            })
     209            .on('jcarouselcontrol:inactive', function() {
     210                $(this).addClass('inactive');
     211            })
     212            .jcarouselControl({
     213                target: '+=1'
     214            });
     215               
     216                $('.jcarousel')
     217                        .on('mouseenter', function(){
     218                                $(this).jcarouselAutoscroll('stop')
     219                        })
     220                        .on('mouseleave', function(){
     221                                $(this).jcarouselAutoscroll('start')
     222                        });
     223{/literal}{/footer_script}
     224
     225{/if}
    154226{/if}
    155227
  • extensions/Slimi/template/mainpage_categories.tpl

    r18917 r25998  
    11{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 
     2<div id="carousel">
    113<div id="wrap">
    12           <ul id="carousel" class="jcarousel-skin-cat">
    13 
     4        <div class="jcarousel">
     5          <ul>
    146                {foreach from=$category_thumbnails item=cat}
    15 
    16 
    177                        <li>
    188                                        <div class="illustration">
     
    4030                {/foreach}
    4131        </ul>
    42 {footer_script}{literal}
    43 function 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 
    61 jQuery(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}
    7232</div>
    7333</div>
    74 
     34        <a href="#" class="jcarousel-control-prev">&lsaquo;</a>
     35    <a href="#" class="jcarousel-control-next">&rsaquo;</a>
     36</div>
  • extensions/Slimi/template/thumbnails.tpl

    r19019 r25998  
    33    global $page, $template;
    44    $template->assign('cat_name', $page['category']['name']);
    5        
    6         global $Slimi;  $this->assign( 'Slimi', $Slimi);
    75{/php}
    86
    97
    10 <div id="carouselthumb">
     8<div id="carousel">
    119<div id="wrap">
    12 <ul id="carousel" class="jcarousel-skin-cat">
     10                <div class="jcarousel">
     11<ul>
    1312                {if !empty($category_thumbnails)}
    1413               
     
    3938        {assign var=derivative value=$pwg->derivative($carousel, $thumbnail.src_image)}
    4039                        <li>
    41                                 <div class="iIllustration">
     40                                <div class="illustration">
    4241                                        <a href="{if ($Slimi.lytebox_slimi)==1}{$thumbnail.path}" class="lytebox" rev="slide:true group:name showNavigation:true navType:1 slideInterval:6000"{else}{$thumbnail.URL}"{/if} title="{$thumbnail.NAME|strip_tags:false|replace:'\'':'&#39;'|replace:'"':'&quot;'}">
    4342                                        <img class="thumbnail" src="{$derivative->get_url()}" alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}" height="{$carousel->max_height()}"/>
     
    7372        {/foreach}
    7473</ul>
    75 {footer_script}{literal}
    76 function mycarousel_initCallback(carousel)
    77 {
    78     // Pause autoscrolling if the user moves with the cursor over the clip.
    79     carousel.clip.hover(function() {
    80         carousel.stopAuto();
    81     }, function() {
    82         carousel.startAuto();
    83     });
    84 };
    85 
    86 jQuery(document).ready(function() {
    87     jQuery('#carousel').jcarousel({
    88         auto: 0,
    89                 wrap: 'circular',
    90                 scroll: 2,
    91                 initCallback: mycarousel_initCallback,
    92                
    93     });
    94 });
    95 
    96 {/literal}{/footer_script}
    9774
    9875</div>
    9976</div>
     77        <a href="#" class="jcarousel-control-prev">&lsaquo;</a>
     78    <a href="#" class="jcarousel-control-next">&rsaquo;</a>
     79</div>
Note: See TracChangeset for help on using the changeset viewer.