I have a button that when switching shows / hides div ('.reportOptions'), this works fine.
$('.reportOptions').click(function(e){
e.stopPropagation();
});
$('.requestOptions').toggle(
function(){
$(this).parent().find('.reportOptions').css('display','block');
},function(){
$('.reportOptions').css('display','none');
}
);
the same div can also be hidden by clicking on it by doing the following
$(document).click(function(){
$('.reportOptions').css('display','none');
$('.requestOptions').toggle(even);
});
The problem with the last function is that if it is executed, I have to double-click the resuestOptions button to display the div again.
I want to know if there is a way that you can reset switch the state without having to change the switch function.
mk_89 source
share