How can I use jQuery plugins predefined events?

How can I use jQuery plugins predefined events?

How can I use jQuery plugins predefined events?
Most of jQuery Plugins introduce predefined events in their documentations, Is there any general standard rules for implementing those events?

For example in special case Zebra Accordion plugin (a tiny accordion plugin for jQuery) or any other plugin defines some Events like below:


Zebra Accordion Events:

onClose: Event fired after a tab is collapsed.

onOpen: Event fired after a tab is collapsed.


If I want in this case to add a div with special font awesome character (like fa-chevron-down) after box title when collapsed (Closed, collapsed state) and remove that character and replace it with new character (like fa-chevron-up) as box title when expended(opened state).
I try below code but it seems that something is wrong:

  1. $('.Zebra_Accordion').on('onOpen', function(e) {
          $(this).append( "<span class='fa fa-chevron-down'></span>" );
      });
    
    $('.Zebra_Accordion').off('onClose', function(e) {
          $(this).append( "<span class='fa fa-chevron-up'></span>" );
      });
I'm beginner and not an expert, So please try to give a detailed answer or any reference as I don't know anything about Plugins events and some other expressions.
Thanks.