source: extensions/flop_style/mainpage_categories/spotlight.tpl @ 16501

Last change on this file since 16501 was 16501, checked in by flop25, 12 years ago

adding a gif loader (introduced in 2.4.2)
fixing the height of medium_cat.tpl
adding a custom size for spotlight.tpl

File size: 2.3 KB
Line 
1{combine_css path="template-extension/flop_style/mainpage_categories/spotlight.css"}
2{combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'}
3{combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'}
4{footer_script require='jquery'}{literal}
5jQuery(document).ready(function () {
6 
7    //loop through all the children in #items
8    //save title value to a span and then remove the value of the title to avoid tooltips
9    jQuery('#items .item').each(function () {
10        title = jQuery(this).attr('title');
11        jQuery(this).append('<span class="caption">' + title + '</span>');   
12        jQuery(this).attr('title','');
13    });
14 
15    jQuery('#items .item').hover(
16        function () {
17            //set the opacity of all siblings
18            jQuery(this).siblings().css({'opacity': '0.1'});
19             
20            //set the opacity of current item to full, and add the effect class
21            jQuery(this).css({'opacity': '1.0'}).addClass('effect');
22             
23            //show the caption
24            jQuery(this).children('.caption').show();   
25        },
26        function () {
27            //hide the caption
28            jQuery(this).children('.caption').hide();       
29        }
30    );
31     
32    jQuery('#items').mouseleave(function () {
33        //reset all the opacity to full and remove effect class
34        jQuery(this).children().fadeTo('100', '1.0').removeClass('effect');     
35    });
36     
37});
38
39{/literal}{/footer_script}
40{define_derivative name='spotlight' width=$derivative_params->max_width() height=$derivative_params->max_height() crop=true}
41
42<div id="items">
43{foreach from=$category_thumbnails item=cat}
44{assign var=derivative value=$pwg->derivative($spotlight, $cat.representative.src_image)}
45  <a href="{$cat.URL}" class="item" title="{$cat.NAME|@replace:'"':' '}{if not empty($cat.DESCRIPTION)} - {$cat.DESCRIPTION|@replace:'"':' '}{/if}" style="{assign var=sz value=$derivative->get_size()}width:{$sz[0]}px;height:{$sz[1]}px">
46    <img {if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="{$ROOT_URL}{$themeconf.img_dir}/ajax-loader-big.gif" data-src="{$derivative->get_url()}"{/if} alt="{$cat.TN_ALT}" {$derivative->get_size_htm()}>
47  </a>
48{/foreach}
49</div>
Note: See TracBrowser for help on using the repository browser.