You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
705 B

semantic.menu = {};
// ready event
semantic.menu.ready = function() {
// selector cache
var
$menuItem = $('.menu a.item, .menu .link.item'),
$dropdown = $('.main.container .menu .dropdown'),
// alias
handler = {
activate: function() {
if(!$(this).hasClass('dropdown')) {
$(this)
.addClass('active')
.closest('.ui.menu')
.find('.item')
.not($(this))
.removeClass('active')
;
}
}
}
;
$dropdown
.dropdown({
on: 'hover'
})
;
$menuItem
.on('click', handler.activate)
;
};
// attach ready event
$(document)
.ready(semantic.menu.ready)
;