You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
689 B
JavaScript
23 lines
689 B
JavaScript
10 years ago
|
"use strict";
|
||
|
|
||
|
$(document).ready(function() {
|
||
|
setupSlideMenu();
|
||
|
|
||
|
function setupSlideMenu() {
|
||
|
$('[data-toggle="slide-in"]').on('click', function(ev) {
|
||
|
$('body').toggleClass('slide-in');
|
||
|
|
||
|
if ($('body').hasClass('slide-in')) {
|
||
|
var top = ($('html').scrollTop() || $('body').scrollTop()) + $('header-menu').height()
|
||
|
|
||
|
$('#header-menu').css('transform', 'translate3d(0, ' + top + 'px, 0)');
|
||
|
$('html').css('overflow-y', 'hidden');
|
||
|
} else {
|
||
|
$('body').one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend", function() {
|
||
|
$('#header-menu').css('transform', 'none');
|
||
|
$('html').css('overflow-y', 'scroll');
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
});
|