jquery - slideToggle callback function not working -
i have button uses slidetoggle() method show hide element. trying change value of button once slideup complete. have tried using callback function change value can't work.
$('#togglefilters').click(function(){ var el = $(this); $('.formselect').slidetoggle(['slow','swing'], function() { if($(this).is(":hidden")) { $(el).val('show filters'); } else { $(el).val('hide filters'); } }); }); if can point me in right direction appreciated?
cheers graham
ok didn't bother looking @ slidetoggle() call in end , went classtoggle function instead.
$('.showhidefilters').click(function() { $(this).toggleclass('shown'); $('.formselect').slidetoggle(['slow','swing']); });
Comments
Post a Comment