12 lines
232 B
JavaScript
12 lines
232 B
JavaScript
function Menu(options) {
|
|
var elem = options.elem;
|
|
|
|
elem.onmousedown = function() { return false; }
|
|
|
|
elem.onclick = function(event) {
|
|
if (event.target.closest('.title')) {
|
|
elem.classList.toggle('open');
|
|
}
|
|
};
|
|
|
|
}
|