Reputation:
I have the following:
$("body").removeClass("open", function()
{
$(".sidebar").hide();
});
It removes the class from the body
, but it doesn't hide the sidebar and I'm not sure why. The class names are definitely correct.
I need the sidebar to be hidden after the animation of removing class .open
is done.
Upvotes: 0
Views: 92
Reputation: 8610
removeClass
only takes one argument; It's immediate, not asynchronous, so you can just run this.
$("body").removeClass("open");
$(".sidebar").hide();
Upvotes: 3
Reputation: 224886
Why are you passing a callback to removeClass
? It doesn’t accept one.
$("body").removeClass("open");
$(".sidebar").hide();
Upvotes: 2