I have a accordion menu with a header image that changes based on the state (open/closed) the problem is once any part of the menu is open the open state images stays, even if the section of the menu is closed. I'd like the closed state to come back once that part of the menu is closed.
Code
$(document).ready(function() {
//slides the element with class "menu_body" when paragraph with class
//"sidemenu_head" is clicked
$("#firstpane p.sidemenu_head").click(function() {
$(this).css({backgroundImage:"url(g/down.png)"})
.next("div.sidemenu_body")
.slideToggle(300)
.siblings("div.sidemenu_body")
.slideUp("fast");
$(this).siblings()
.css({backgroundImage:"url(left.png)"});
});
The Page