This commit is contained in:
Alexander Agnarson 2020-08-16 13:53:37 +02:00
parent d26d209ebd
commit 0758928289
11 changed files with 905 additions and 312 deletions

View file

@ -69,18 +69,6 @@ jQuery(document).ready(function($) {
/* Table odd row class
/* ------------------------------------ */
$('table tr:odd').addClass('alt');
/* Dropdown menu animation
/* ------------------------------------ */
$('.nav ul.sub-menu').hide();
$('.nav li').hover(
function() {
$(this).children('ul.sub-menu').slideDown('fast');
},
function() {
$(this).children('ul.sub-menu').hide();
}
);
/* Fitvids
/* ------------------------------------ */
@ -112,37 +100,4 @@ jQuery(document).ready(function($) {
pushup: ''
});
/* Mobile menu smooth toggle height
/* ------------------------------------ */
$('.nav-toggle').on('click', function() {
slide($('.nav-wrap .nav', $(this).parent()));
});
function slide(content) {
var wrapper = content.parent();
var contentHeight = content.outerHeight(true);
var wrapperHeight = wrapper.height();
wrapper.toggleClass('expand');
if (wrapper.hasClass('expand')) {
setTimeout(function() {
wrapper.addClass('transition').css('height', contentHeight);
}, 10);
}
else {
setTimeout(function() {
wrapper.css('height', wrapperHeight);
setTimeout(function() {
wrapper.addClass('transition').css('height', 0);
}, 10);
}, 10);
}
wrapper.one('transitionEnd webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd', function() {
if(wrapper.hasClass('open')) {
wrapper.removeClass('transition').css('height', 'auto');
}
});
}
});