Hi,
it seems that i have a very exotic wish to use this wonderful menu.
1.)
I like to use smartmenu for a vertical accordeon menu, where the toogle link (I mean the parent link) is clickable (to another site) and not only a toogle to open the submenu, and
2.)
if a link in the submenu is clicked – that the submenus still remains open and is not closed after page load.
Part 1 is solved – i think so (with help of this forum) with this code
var $mainMenu = $('#main-menu').on('click', 'span.sub-arrow', function(e) {
// toggle the sub menu on sub arrow click in collapsible mode
var obj = $mainMenu.data('smartmenus');
if (obj.isCollapsible()) {
var $item = $(this).parent(),
$sub = $item.parent().dataSM('sub'),
subIsVisible = $sub.dataSM('shown-before') && $sub.is(':visible');
$sub.dataSM('arrowClicked', true);
obj.itemActivate($item);
if (subIsVisible) {
obj.menuHide($sub);
}
e.stopPropagation();
e.preventDefault();
}
}).bind({
// don't show the sub menu in collapsible mode unless the sub arrow is clicked
'beforeshow.smapi': function(e, menu) {
var obj = $mainMenu.data('smartmenus');
if (obj.isCollapsible()) {
var $menu = $(menu);
if (!$menu.dataSM('arrowClicked')) {
return false;
}
$menu.removeDataSM('arrowClicked');
}
},
'show.smapi': function(e, menu) {
$(menu).dataSM('parent-a').children('span.sub-arrow').text('-');
},
'hide.smapi': function(e, menu) {
$(menu).dataSM('parent-a').children('span.sub-arrow').text('+');
}
});
but how can i keep the submenu open if active?
Nay help would be wonderful.
Thanks
Jimbob