User talk:Shredder13

Welcome
Welcome to Central Wikia, Shredder13!

We're a friendly community here; most of us are active on an individual wiki, and many of us are active on more than one.

If you're looking for help, a help wiki can be found here, and you're welcome to ask the community questions on the Help Desk. If you need assistance from a staff member, you can contact the Community Team using Special:Contact.

You can get live help from community members and staff in our IRC channel. There are also channels for larger Wikia and their communities. Here you can socialize and get to know your community!

If you have an idea for a new wiki, please create one! Check out our list of new wikis and see if any of them interest you. A directory of existing wikis is also available.

Finally, please keep an eye on the recent changes to see what the community is up to here.

Enjoy! -- Angela (Talk) 06:39, 19 June 2009

Re: Navbox
Hey Shredder13, if you still need help with a navbox, here you go. Add this code to your wiki's MediaWiki:Common.css: /* default skin for navigation boxes */ table.navbox { background-color: #F9F9F9; border: 1px solid #AAA; clear: both; font-size: 90%; margin: 1em 0em 0em; padding: 2px; text-align: center; width: 100%; } table.navbox th { background-color: #CCF; padding-left: 1em; padding-right: 1em; } @media print { .navbox { display: none; } }

You should now be able to make a navbox by adding  at the start of a table, such as in the example below:

which will look like:

IF you want, I can also give you code that will allow a "show/hide" option to appear which can collapse the navbox.--Richardtalk 16:17, 24 June 2009 (UTC)

Show/hide
Alright, then add this code to your wiki's MediaWiki:Common.js:  /* Test if an element has a certain class ************************************** * * Description: Uses regular expressions and caching for better performance. * Taken from Wikipedia's Common.js. */ var hasClass = (function {     var reCache = {};     return function (element, className) {         return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);    }; });

/** Collapsible tables ********************************************************* * *  Description: Allows tables to be collapsed, showing only the header. See *              NavFrame. * Taken from Wikipedia's Common.js. */ var autoCollapse = 2; var collapseCaption = "hide"; var expandCaption = "show"; function collapseTable( tableIndex ) {    var Button = document.getElementById( "collapseButton" + tableIndex ); var Table = document.getElementById( "collapsibleTable" + tableIndex ); if ( !Table || !Button ) { return false; }    var Rows = Table.rows; if ( Button.firstChild.data == collapseCaption ) { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = "none"; }        Button.firstChild.data = expandCaption; } else { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = Rows[0].style.display; }        Button.firstChild.data = collapseCaption; } } function createCollapseButtons {    var tableIndex = 0; var NavigationBoxes = new Object; var Tables = document.getElementsByTagName( "table" ); for ( var i = 0; i < Tables.length; i++ ) { if ( hasClass( Tables[i], "collapsible" ) ) { /* only add button and increment count if there is a header row to work with */ var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0]; if (!HeaderRow) continue; var Header = HeaderRow.getElementsByTagName( "th" )[0]; if (!Header) continue; NavigationBoxes[ tableIndex ] = Tables[i]; Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex ); var Button    = document.createElement( "span" ); var ButtonLink = document.createElement( "a" ); var ButtonText = document.createTextNode( collapseCaption ); Button.style.styleFloat = "right"; Button.style.cssFloat = "right"; Button.style.fontWeight = "normal"; Button.style.textAlign = "right"; Button.style.width = "6em"; ButtonLink.style.color = Header.style.color; ButtonLink.setAttribute( "id", "collapseButton" + tableIndex ); ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" ); ButtonLink.appendChild( ButtonText ); Button.appendChild( document.createTextNode( "[" ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( "]" ) ); Header.insertBefore( Button, Header.childNodes[0] ); tableIndex++; }    }     for ( var i = 0;  i   such as in the example below. You can also set it so that the table is collapsed automatically by doing  . This works with every kind of table, not just navboxes.

--Richardtalk 20:07, 25 June 2009 (UTC)