BeefUp
BeefUp copied to clipboard
Feature Request: "is-opening" & "is-closing" class.
Thanks for this great plugin! I'd like the carrot to start animating as soon as the accordion is clicked, but it doesn't get the "is-open" class till the animation has finished. Could there be a option to make it get the class right when it's clicked, or add classes that indicate when the item is opening and closing. I could then just add these to my css selectors for the open and close states and it would solve the problem.
A workaround for the time being is adding this script...
jQuery(".beefup__head").on('click', function(event){
if(jQuery(this).parent().hasClass('is-open')) {
jQuery(this).parent().addClass('closing');
}else {
jQuery(this).parent().addClass('opening');
}
});
and then using beefup to remove the classes once toggling has finished...
jQuery('.beefup').beefup({
onClose: function ($this) {
$this.removeClass('closing');
},
onOpen: function ($this) {
$this.removeClass('opening');
},
etc…
});