-
-
Save Braunson/6887262 to your computer and use it in GitHub Desktop.
That script is not working fine on windows phone 8. menu is not getting opened for this. Please suggest. Also that is not working for IE version
Thanks @miix -- Updated the Gist.
How can the menu automatically be closed when I click on one of the buttons in menu ?
please help. how to do the same using mousehover instead of click? please help
After some hours I got a solution to close the sidebar with the same button.
I changed
classie.addClass(container, 'st-menu-open');
to
classie.toggleClass(container, 'st-menu-open');
With no effect. Then I changed
container.className = 'st-container';
to
container.id = 'st-container';
Now it works! I can open and close with the same button.
(I made a burger icon)
`buttons.forEach(function(el, i) {
var effect = el.getAttribute('data-effect');
el.addEventListener(eventtype, function(ev) {
ev.stopPropagation();
ev.preventDefault();
container.id = 'st-container'; // ORIGINAL: container.className = 'st-container';
classie.add(container, effect);
setTimeout(function() {
classie.toggleClass(container, 'st-menu-open'); // FIX: Vorher: addClass
}, 25);
document.addEventListener(eventtype, bodyClickFn);
//closeMenu.addEventListener(eventtype, closeMenuClickFn);
});
});`
You are amazing!
Thank you,