SMF For Free Support Forum
Signup For Free Forum
October 11, 2008, 03:17:26 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [Code] Reorder Tabs  (Read 403 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 640


Do not PM me for Code Support or Request


View Profile
« on: May 29, 2008, 03:03:54 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.
Logged

SMC Code Index - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.[/center]
pker own
SMF For Free Sr. Member
*
Offline Offline

Posts: 372


View Profile WWW
« Reply #1 on: May 29, 2008, 03:04:49 pm »

W00T, Nice code Agent Moose people have been wanting this!!GJ you tested it? Hehe, I made a test forum.

http://reordertest.smfforfree4.com/index.php

I used the example if you want to see it  Smiley.
« Last Edit: May 29, 2008, 03:31:14 pm by pker own » Logged

Jason Jones
SMF For Free Member
*
Offline Offline

Posts: 31


Live for yourself because life is too short


View Profile WWW
« Reply #2 on: May 29, 2008, 05:32:57 pm »

Hi, I was wondering what type of coding this used because I only know how to do a bit of HTML and I would like to learn how to code for this =)
Logged

3lf-ครรครรเภ
SMF For Free Full Member
*
Offline Offline

Posts: 108



View Profile
« Reply #3 on: June 11, 2008, 02:32:37 pm »

im guessing its javaScript
Logged

Shimmy Shabby
SMF For Free Member
*
Offline Offline

Posts: 91


Shimmy + Shabby = Me


View Profile WWW
« Reply #4 on: June 11, 2008, 08:02:23 pm »

My best guess would be JavaScript. But JavaScript is kind of similar to HTML.
Logged

3lf-ครรครรเภ
SMF For Free Full Member
*
Offline Offline

Posts: 108



View Profile
« Reply #5 on: June 13, 2008, 02:57:34 pm »

i sort of said that.
Logged

Supernovadelta
SMF For Free Full Member
*
Offline Offline

Posts: 106


Supernovadelta Productions.


View Profile WWW
« Reply #6 on: June 17, 2008, 12:12:24 am »

Nice post Agent Moose.Thanks for this. Grin
Logged



Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
ServerBeach Coupon
Page created in 0.215 seconds with 18 queries.