Skip to content

Navigation Menu

Sign in
Sign up

correction with the size on which the closing of the menu depends #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
norair87 wants to merge 1 commit into ArmGono:master
base: master
Choose a base branch
Loading
from norair87:master
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion jquery.togglemenu.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'burgerParent': false
}, options);
var _toggleMenu = {};
_toggleMenu.lastWidth = 0;
_toggleMenu.hide = function ($item) {
if (settings.jsHide) {
$item.hide();
Expand Down Expand Up @@ -84,7 +85,7 @@
var $mobileMenu = $('<div />').addClass('toggle-menu-mobile');
var $content = $('<div id="toggle-menu-content"></div>');
$mobileMenu.append('<div class="toggle-menu-title">' + settings.title + '</div>');
var $close = $('<a href="#close-menu" class="toggle-menu-close"><span>Закрыть</span></a>');
var $close = $('<a href="#close-menu" class="toggle-menu-close"><span class="glyphicon glyphicon-remove"></span></a>');
$content.append($menu)
if (!$.isEmptyObject(settings.appendBlock)) {
$content.append(settings.appendBlock);
Expand All @@ -95,6 +96,10 @@
var $window = $(window);
$window.resize(function () {
var width = $window.width();
if(width === _toggleMenu.lastWidth) {
return;
}
_toggleMenu.lastWidth = width;
_toggleMenu.check($this, $window.width());
$mobileMenu.addClass('toggle-menu-mobile-hide');
settings.body.removeClass('toggle-menu-opened');
Expand All @@ -112,3 +117,4 @@
});
};
})(jQuery, window);

AltStyle によって変換されたページ (->オリジナル) /