bebeboutik/modules/filtervp/filter.tpl

46 lines
1.3 KiB
Smarty
Raw Permalink Normal View History

2016-01-04 12:49:26 +01:00
{if count($sizes) > 0}
2018-03-16 10:12:24 +01:00
<div class="block_filter">
2016-01-04 12:49:26 +01:00
<div class="content">
2018-03-19 10:15:54 +01:00
<h4 class="open">{l s='Recherche par' mod='filtervp'}</h4>
2017-04-20 09:47:13 +02:00
2016-01-04 12:49:26 +01:00
<div class="content_filter">
<ul id="filters">
{foreach from=$sizes item=size}
<li>
<input type="checkbox" name="size" value="{$size.id_attribute}" id="size_{$size.id_attribute}">
<label for="size_{$size.id_attribute}">{$size.name}</label>
</li>
{/foreach}
</ul>
</div>
</div>
</div>
{/if}
<script>
{literal}
$(document).ready(function() {
$('.open').live('click', function(e){
e.preventDefault();
2017-04-20 09:47:13 +02:00
if($('#privatesales_categories_block_left').length>0) {
$('.block_filter .content').css({'position':'relative'});
var new_top = $('#privatesales_categories_block_left').position().top;
}
2017-04-20 09:47:13 +02:00
2016-01-04 12:49:26 +01:00
$(this).toggleClass('active');
$('.content_filter').toggle();
if($('#privatesales_categories_block_left').length>0) {
if($(this).hasClass('active') == true) {
new_top = $('#privatesales_categories_block_left').position().top + $('.block_filter .content_filter').height() + 25;
} else {
new_top = $('.block_filter').position().top + $('.block_filter').height();
}
$('#privatesales_categories_block_left').css({'top': new_top});
}
2016-01-04 12:49:26 +01:00
});
});
{/literal}
</script>