I have an action start element .oven_program_01
, panel with class .oven_panel
started after click at this element.
I have another element .back_button
which closes this panel.
When I open the panel again I can't close it. The display does't change.
This is my script:
opening action:
$('.oven_program_01').live('click', function() {
$('.back_button').addClass('oven_panel_close_button');
$('.oven_panel').fadeIn(300);
});
closing action:
$('.back_button').click(function() {
if ($(this).hasClass("oven_panel_close_button")) {
$('.oven_panel').fadeOut(300);
$('.back_button').removeClass("oven_panel_close_button")
}
else {
$(this).addClass("oven_panel_close_button")
}
});