Skip to content

Instantly share code, notes, and snippets.

@hpstuff
Created January 12, 2016 13:20
Show Gist options
  • Select an option

  • Save hpstuff/453561e38a3b5cbd4b22 to your computer and use it in GitHub Desktop.

Select an option

Save hpstuff/453561e38a3b5cbd4b22 to your computer and use it in GitHub Desktop.
velocity.js
$(".hamb").on("click", function() {
$(this).hasClass("open") ? : closeMenu(this), openMenu(this);
});
function openMenu(hamb){
$(hamb).addClass("open");
$(hamb).find("i").addClass("cross").removeClass("menubar");
$.Velocity.RunSequence(menuOpen);
}
function closeMenu(hamb){
$(hamb).removeClass("open");
$(hamb).find("i").addClass("menubar").removeClass("cross");
var options = {
height: 0,
width: 0,
minHeight: 0
};
$("nav").velocity(options, {
duration: 250,
begin: function() {
$("nav").find("h1, p, small").css({
opacity: 0
});
$(".right-inner").find("li, .social i").css({
opacity: 0
});
},
complete: function() {
$(".right-inner").css({
width: 0
})
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment