A jQuery plugin for toggling events like .toggle() did pre 1.9.
Include script after the jQuery library:
<script src="/path/to/jquery.toggle-event.js"></script>
You may have as many handlers as you want and they will be called in order
$( "#target" ).toggleEvent(
'click',
function() {
alert( "First handler for .toggle() called." );
},
function() {
alert( "Second handler for .toggle() called." );
}
);