Jquery - toggle problem -


i have toggle function

$('#togglebtn').toggle(function() {  $('#panel').show(); }, function() {  $('#panel').hide(); }); 

i have button close/hide panel

$('#otherbtn').click(function() {  $('#panel').hide(); }); 

all trying when hide panel #otherbtn event still active on #togglebtn , gives me click start toggle panel again. how can fix that?

trigger click event on toggle button.

$('#otherbtn').click(function() {  $('#panel').hide();  $('#togglebtn').click(); //resets tooglebtn state }); 

Comments

Popular posts from this blog

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -