Skip to content

Commit

Permalink
v3.0.0 New version JS
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-5 committed Sep 24, 2017
1 parent 08b733b commit 3df013b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions js/ma5-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ if (isIE()) {
}
// detect scrollbar
function detectElementScrollbar() {
if ($('body').outerHeight() > $(window).height()) {
$('html').addClass('has-body-scrollbar');
} else {
$('html').addClass('hasnt-body-scrollbar');
}
$('[data-detect-scrollbar]').each(function() {
if($(this).get(0).scrollHeight > $(this).get(0).clientHeight) {
$(this).addClass('has-scrollbar').removeClass('hasnt-scrollbar');
Expand All @@ -116,6 +121,7 @@ $(document).ready(function () {
}
});
});

$(window).on('resize', function () {
detectElementScrollbar();
});
Expand All @@ -126,3 +132,4 @@ $(window).on('load', function () {




2 changes: 1 addition & 1 deletion js/ma5-menu.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3df013b

Please sign in to comment.