<script type="text/javascript">
$(document).ready(function () {
$('#cssmenu li.has-sub > a').on('click', function(){
$(this).removeAttr('href');
var element = $(this).parent('li');
if (element.hasClass('open')) {
element.removeClass('open');
element.find('li').removeClass('open');
element.find('ul').slideUp();
}
else {
element.addClass('open');
element.children('ul').slideDown();
element.siblings('li').children('ul').slideUp();
element.siblings('li').removeClass('open');
element.siblings('li').find('li').removeClass('open');
element.siblings('li').find('ul').slideUp();
}
});
$('#cssmenu>ul>li.has-sub>a').append('<span class="holder"></span>');
});
</script>
<script>
$(function(){
$('.drow_menu li ul li').children('ul')
.each(function(){
$(this).css('display','block');
});
});
</script>
<div id="cssmenu">
{function name=categories_tree}
{if $categories}
<ul>
{foreach $categories as $c}
{if $c->visible}
<li class="active{if $c->subcategories} has-sub{/if}">
<a href="catalog/{$c->url}" data-category="{$c->id}">{$c->name}</a>
{if $c->subcategories}{categories_tree categories=$c->subcategories}{/if}
</li>
{/if}
{/foreach}
</ul>
{/if}
{/function}
{categories_tree categories=$categories}
</div>