Snippets/Top icons
From MediaWiki.org
< Snippets
|
|
|
|---|---|
| Language(s): | javascript, css |
| Compatible with: |
MediaWiki 1.17+ (Vector; Monobook) |
Description [edit]
Icons on the top right of the article. Use class="Top_icon_raw" in the icon templates to trigger it. No styles should be set (so no position, float, clear, margin, padding etc.) the script will take care of this.
JavaScript [edit]
/** * Icons on the top right of the article. * See also CSS * * @source www.mediawiki.org/wiki/Snippets/Top_icons * @version 4 */ jQuery( document ).ready( function ( $ ) { $( '.Top_icon_raw' ) .removeClass( 'Top_icon_raw' ) .addClass( 'Top_icon_dynamic' ) .prependTo( '#firstHeading' ); } );
Stylesheet [edit]
/** * Icons on the top right of the article. * See also JS * * @source www.mediawiki.org/wiki/Snippets/Top_icons * @version 4 */ /* Hide without javascript */ .Top_icon_raw { display: none; } /* With JavaScript */ .Top_icon_dynamic { float: right; padding-left: 10px; font-size: 50%; width: auto !important; } .Top_icon_raw p, .Top_icon_dynamic p { padding: 0; margin: 0; }