Template:Collapse/2

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Collapse/2

{{{1}}} ink = $toggle.unbind( 'click.mw-collapse' ).bind( 'click.mw-collapse', function( e ){ toggleLinkPremade( $toggle, e ); } ); }

} else { //
,

etc.

// If a direct child .content-wrapper does not exists, create it if ( !$that.find( '> .mw-collapsible-content' ).size() ) {

$that.wrapInner( '
' );

}

// The toggle-link will be the first child of the element var $toggle = $that.find( '> .mw-collapsible-toggle' );

// If theres no toggle link, add it if ( !$toggle.size() ) { $that.prepend( $toggleLink ); } else { $toggleLink = $toggle.unbind( 'click.mw-collapse' ).bind( 'click.mw-collapse', function( e ){ toggleLinkPremade( $toggle, e ); } ); } } }

// Initial state (only for those that are not custom) if ( $that.hasClass( 'mw-collapsed' ) && $that.attr( 'id' ).indexOf( 'mw-customcollapsible-' ) !== 0 ) { $that.removeClass( 'mw-collapsed' ); // The collapsible element could have multiple togglers // To toggle the initial state only click one of them (ie. the first one, eq(0) ) // Else it would go like: hide,show,hide,show for each toggle link. $toggleLink.eq(0).click(); }

Documentation icon Documentationviewedithistorypurge

This documentation is transcluded from Template:Collapse/2/doc.

Template:Collapse/2/doc