Прошу выложить пример кода для categories.htm, т.к у вас нет примера и в одном шаблоне, как сделать многоуровневое выпадающее меню как на сайте mypad.com.ua
Для не програмиста тяжело разобраться.
Заранее благодарен.
Прошу выложить пример кода для categories.htm, т.к у вас нет примера и в одном шаблоне, как сделать многоуровневое выпадающее меню как на сайте mypad.com.ua
Для не програмиста тяжело разобраться.
Заранее благодарен.
Для simpla есть
js
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script langugage="javascript" type="text/javascript">
$(document).ready(function() {
initMenu('.categories ul');
function initMenu (id) {
$(id + ' ul').hide().parent().addClass('subcat');
if ($(id).find('a.selected')) {
$(id).find('a.selected').addClass('selected').parents('ul').show().parents('li').show();
} else $(id + ' ul:first').show();
$(id + ' a').click( function () {
checkElement = $(this).next();
if (checkElement.is('ul')) {
if (!checkElement.is(':visible')) {
// $(id + ' ul:visible').slideUp('normal');
checkElement.slideDown('normal');
} else checkElement.slideUp('normal');
return false;
}
});
}
})
</script>
html
<div class=categories>
{function name = categories_tree}
{if $categories}
<ul>
{foreach $categories as $c}
{* Показываем только видимые категории *}
{if $c->visible}
<li>
{if $c->image}
<img src="{$config->categories_images_dir}{$c->image}" alt="{$c->name}">
{/if}
<a {if $category->id == $c->id}class="selected"{/if} href="catalog/{$c->url}" data-category="{$c->id}">
{$c->name}
</a>
{categories_tree categories=$c->subcategories}
</li>
{/if}
{/foreach}
</ul>
{/if}
{/function}
{categories_tree categories=$categories}
</div>
css
.categories ul, .categories li {
padding-top: 5px;
margin: 0;
list-style: none;
background: none;
}
.categories a {
background: url("../images/marker.png") no-repeat scroll left 4px transparent;
color: #484848;
font: 12px/18px Arial;
padding-left: 14px;
}
.categories a:hover {
text-decoration: underline;
background: #eb540d;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
color: #fff;
}
.categories ul ul a:hover {
text-decoration: none;
}
.categories ul ul {
margin-right: 3px;
background: #f9f9f8;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
padding: 2px 0 6px 14px;
}
.categories li.subcat {
border-top: 1px solid #D9D9D9;
padding: 4px 9px;
position: relative;
}
.categories ul ul li {
margin-right: 3px;
margin-bottom: 1px;
background: none;
}
.categories ul ul a {
color: #34627b;
text-decoration: underline;
font: 14px Tahoma, Arial;
border: none;
}
.categories ul li a.selected {
color: #eb540d;
text-decoration: underline;
font: 18px Tahoma, Arial;
border: none;
}
.categories ul ul li a.selected {
font-weight: bold;
color: #eb540d;
font-size: 14px;
}
.categories ul ul ul li a.selected {
font-weight: bold;
color: #eb540d;
font-size: 14px;
}