Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2004, 07:16 AM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Expanding List

Yes I have finally gotten what I wanted, thanks to the help of my support team member: Dennistt and a public code that is available online, we have managed to come up with a Expanding List. So here goes.

Name: Expanding List
Original Code Author: http://www.scit.wlv.ac.uk/~jphb/javascript/emenu.html
Expansion Author: DennisTT
Expansion Code Copyrighted: GlobalRPGs & DennisTT
Demo: Races Demo List

Instructions: Create a new template such as "list" (without the " ") and paste the following code into the new template.

Click Save

Then whatever page you want to use this on, make sure you use that template you just created.

NOTE: Remember, edit the information following the example in the code to whatever you want. You can name the template whatever you want, just make sure you put whatever you plan to use the list for as the template name.

Code:
<!-- Creation date: 12/30/2004 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="DennisTT">
<script>
<!--
// Original: http://www.scit.wlv.ac.uk/~jphb/javascript/emenu.html
// Modified by DennisTT for GlobalRPGs

var Race1 = new Object();
Race1.Info = new Array(
	"Header",
	"Text about Header",
	"Header 2",
	"Text about Header2"
);
Race1.Status = "c";

var Race2 = new Object();
Race2.Info = new Array(
	"Header",
	"Text about Header",
	"Header 2",
	"Text about Header2"
);
Race2.Status = "c";

var Race3 = new Object();
Race3.Info = new Array(
	"Header",
	"Text about Header",
	"Header 2",
	"Text about Header2"
);
Race3.Status = "c";

var Opened = null;
var OpenedID = null;

function doList(curr)
{
	var ref = eval(curr.id);
	if(ref.Status == "c")
	{
		if (Opened != null) {
			var OpenedID1 = eval(OpenedID);
			var Opened1 = eval(Opened);
			Opened1.removeChild(OpenedID1.Sublist);
			OpenedID1.Status = "c";
		}	
		ref.Status = "o";
		var list = document.createElement("p");
		var i;
		var j = 1;
		for(i=0;i<ref.Info.length;i++)
		{
			var newText = document.createTextNode(ref.Info[i]);
			if (j == 1) {
				var newNode = document.createElement("b");
			}
			else {
				var newNode = document.createElement("p");
			}
			newNode.appendChild(newText);
			list.appendChild(newNode);
			if (j==1) {j=2;} else {j=1;}
		}
		curr.appendChild(list);
		ref.Sublist = list;
		Opened = curr;
		OpenedID = ref;
	}
	else
	{
		curr.removeChild(ref.Sublist);
		ref.Status = "c";
		Opened = null;
		OpenedID = null;
	}	
}
// -->
</script>
<style type="text/css">
<!--
/* Styles for the toggler link */
div.toggler {cursor: hand}
/* Styles for the text being toggled */
div.toggler p {color: blue;}
/* Styles for the header being toggled*/
div.toggler b {color: red;}
-->
</style>
</head>
<body>
<div id="Race1" class="toggler" onclick="doList(this)">Race1</div>
<div id="Race2" class="toggler" onclick="doList(this)">Race2</div>
<div id="Race3" class="toggler" onclick="doList(this)">Race3</div>

</body>
Enjoy and have fun playing with this.
Myth
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03899 seconds
  • Memory Usage 2,169KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete