I'm currently working on a project where I am trying to create a slide-out menu. However, I've run into some issues because the .animate()
function is not toggle-able.
My plan was to use a CSS class and implement .cssToggle()
instead, but unfortunately, this does not provide the desired animation.
Could someone advise me on the correct method to achieve a toggle effect for this scenario? I want the menu to close again using the same icon.
$( ".menu span" ).click(function() {
$( ".menu" ).animate({
left:0
}, 500, function() {
})
})
You can view the JSFiddle example here.