Simple Machine Codes
November 23, 2009, 12:23:16 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Affiliates Code Index Staff List Calendar Members Login Register  

Reorder Tabs


Pages: [1]   Go Down
  Print  
Author Topic: Reorder Tabs  (Read 190 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,664



View Profile WWW
« on: May 29, 2008, 03:04:40 pm »

Add this to your headers if you don't have it:
Code:
<script src="/jquery.js"></script>

Footers:
Code:
<script>
function MoveTabs(Tab,location,Spot){
if(location == "after"){
//Created by Agent Moose (smcodes.smfforfree3.com)
$(".maintab_back:contains(" + Tab + "),.maintab_active_back:contains(" + Tab + ")").insertAfter(".maintab_back:contains(" + Spot + "),.maintab_active_back:contains(" + Spot + ")");
};
if(location == "before"){
$(".maintab_back:contains(" + Tab + "),.maintab_active_back:contains(" + Tab + ")").insertBefore(".maintab_back:contains(" + Spot + "),.maintab_active_back:contains(" + Spot + ")");
};};
MoveTabs("TAB","BEFORE/AFTER","SPOT");
</script>

Original Request: http://www.smfsupport.com/support/code_requests/req_reorder_tabs_code-t17406.0.html

TAB = The tab you want moved
BEFORE/AFTER = put "before" (without quotations) to put before the tab you want, put "after" to put it after the ttab you want
SPOT = The tab where the tab you want moved will go to, either before or after the selected tab.

Example:
Code:
<script>
function MoveTabs(Tab,location,Spot){
if(location == "after"){
//Created by Agent Moose (smcodes.smfforfree3.com)
$(".maintab_back:contains(" + Tab + "),.maintab_active_back:contains(" + Tab + ")").insertAfter(".maintab_back:contains(" + Spot + "),.maintab_active_back:contains(" + Spot + ")");
};
if(location == "before"){
$(".maintab_back:contains(" + Tab + "),.maintab_active_back:contains(" + Tab + ")").insertBefore(".maintab_back:contains(" + Spot + "),.maintab_active_back:contains(" + Spot + ")");
};};
MoveTabs("Help","before","Arcade");
</script>

That would move the Help tab before the Arcade tab

Enjoy Smiley

PS: if you add the tab before the home tab, when your on the index, it will not look right.  Sorry, but I can't do anything about that.
Report Spam   Logged

legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #1 on: May 30, 2008, 02:06:55 am »

wooot very nice man

thanks alot

legend 1234
Report Spam   Logged

Musicinsanity
Music Is Life.
100 Club Member

Offline Offline

Gender: Male
Posts: 209


www.Musicinsanity.tk - NEED HELP


View Profile WWW
« Reply #2 on: May 30, 2008, 03:12:33 pm »

Wow nice Thanks moose
Report Spam   Logged

I do need advertisers and staff @ WWW.MUSICINSANITY.TK

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2006, Simple Machines LLC
ServerBeach Coupon