I've created a simple menu with a button of which when clicked on should change the size of the menu at alternating heights, I keep receiving some weird action of which my menu just shrinks to the bottom left of the document disappears then reappears the same height; that's how I found out the second function was being executed but not the first. I've changed the code many times but I can't find a solution, maybe someone can help. Here's my code.
$(document).ready(function () {
$("#HideShow").addClass("fa fa-bars").click(function () {
$("#editor").toggle(function () {
$("#editor").slideToggle("fast", function () {
$("#editor").height(20);
});
}, function () {
$("#editor").slideToggle("fast", function () {
$("#editor").height(150);
});
});
});
});
maybe I'm just not getting it, I am fairly new to this so if I am doing something wrong PLEASE correct me.