There is not a function, but here is the code which you could use to write your own:
if ( typeof ezTOC.visibility_hide_by_default != 'undefined' ) {
var toggle = $( 'a.ez-toc-toggle' );
var invert = ezTOC.visibility_hide_by_default;
if ( Cookies ) {
Cookies.get( 'ezTOC_hidetoc' ) == 1 ? toggle.data( 'visible', false ) : toggle.data( 'visible', true );
} else {
toggle.data( 'visible', true );
}
if ( invert ) {
toggle.data( 'visible', false )
}
if ( ! toggle.data( 'visible' ) ) {
$( 'ul.ez-toc-list' ).hide();
}
toggle.click( function( event ) {
event.preventDefault();
if ( $( this ).data( 'visible' ) ) {
$( this ).data( 'visible', false );
if ( Cookies ) {
if ( invert )
Cookies.set( 'ezTOC_hidetoc', null, { path: '/' } );
else
Cookies.set( 'ezTOC_hidetoc', '1', { expires: 30, path: '/' } );
}
$( 'ul.ez-toc-list' ).hide( 'fast' );
} else {
$( this ).data( 'visible', true );
if ( Cookies ) {
if ( invert )
Cookies.set( 'ezTOC_hidetoc', '1', { expires: 30, path: '/' } );
else
Cookies.set( 'ezTOC_hidetoc', null, { path: '/' } );
}
$( 'ul.ez-toc-list' ).show( 'fast' );
}
} );
}