Changeset 16501 for extensions/flop_style/mainpage_categories/spotlight.tpl
- Timestamp:
- Jul 8, 2012, 5:45:23 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/flop_style/mainpage_categories/spotlight.tpl
r16393 r16501 1 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'} 2 4 {footer_script require='jquery'}{literal} 3 $(document).ready(function () {5 jQuery(document).ready(function () { 4 6 5 7 //loop through all the children in #items 6 8 //save title value to a span and then remove the value of the title to avoid tooltips 7 $('#items .item').each(function () {8 title = $(this).attr('title');9 $(this).append('<span class="caption">' + title + '</span>');10 $(this).attr('title','');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',''); 11 13 }); 12 14 13 $('#items .item').hover(15 jQuery('#items .item').hover( 14 16 function () { 15 17 //set the opacity of all siblings 16 $(this).siblings().css({'opacity': '0.1'});18 jQuery(this).siblings().css({'opacity': '0.1'}); 17 19 18 20 //set the opacity of current item to full, and add the effect class 19 $(this).css({'opacity': '1.0'}).addClass('effect');21 jQuery(this).css({'opacity': '1.0'}).addClass('effect'); 20 22 21 23 //show the caption 22 $(this).children('.caption').show();24 jQuery(this).children('.caption').show(); 23 25 }, 24 26 function () { 25 27 //hide the caption 26 $(this).children('.caption').hide();28 jQuery(this).children('.caption').hide(); 27 29 } 28 30 ); 29 31 30 $('#items').mouseleave(function () {32 jQuery('#items').mouseleave(function () { 31 33 //reset all the opacity to full and remove effect class 32 $(this).children().fadeTo('100', '1.0').removeClass('effect');34 jQuery(this).children().fadeTo('100', '1.0').removeClass('effect'); 33 35 }); 34 36 35 37 }); 36 $(document).ready(function() {37 var max_dim_width = 0;38 var max_dim_height = 0;39 $(".item img").each(function () {40 if (jQuery(this).height() > max_dim_height)41 max_dim_height = jQuery(this).height() + 10;42 if (jQuery(this).width() > max_dim_width)43 max_dim_width = jQuery(this).width() + 10;44 45 jQuery(".item, .item img")46 .css('width', max_dim_width+'px')47 .css('height', max_dim_height+'px');48 });49 });50 38 51 39 {/literal}{/footer_script} 40 {define_derivative name='spotlight' width=$derivative_params->max_width() height=$derivative_params->max_height() crop=true} 41 52 42 <div id="items"> 53 43 {foreach from=$category_thumbnails item=cat} 54 <a href="{$cat.URL}" class="item" title="{$cat.NAME|@replace:'"':' '}{if not empty($cat.DESCRIPTION)} - {$cat.DESCRIPTION|@replace:'"':' '}{/if}"> 55 <img src="{$pwg->derivative_url($derivative_params, $cat.representative.src_image)}" alt="{$cat.TN_ALT}" > 56 </a> 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> 57 48 {/foreach} 58 49 </div>
Note: See TracChangeset
for help on using the changeset viewer.