$( ".menu-open" ).click(function() {
$( ".hidden-menu" ).animate({
left: "+=295"
}, 1000, function() {
// Animation complete.
});
$( ".menu-open" ).animate({
opacity: 0
}, 1000, function() {
// Animation complete.
});
});
$('.menu-open').on('click', debounce(function(event) {
console.log(this);
}, 500));
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this;
var args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
}
}