I am facing a strange issue. I have previously used toggleClass and it worked perfectly fine. However, now only the 'class' attribute is being added to the element without actually adding the class itself. Here is an example:
$("#slideButtonMenu").click(function(){
$("#sidebar").toggleClass("slidingLeft");
});
.slidingLeft {
left: -220px;
}
When inspecting the element, this is what I see before clicking "#slideButtonMenu":
<aside id="sidebar"> == $0
After clicking the button:
<aside id="sidebar" class> == $0
The desired outcome after the first click is:
<aside id="sidebar" class="slidingLeft"> == $0
I'm not sure what == $0
means, but I don't think it impacts this issue. If I change toggleClass to addClass, it does add the class successfully... but then I can't slide the menu back out afterwards.