List Based Menus

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
kenlight
Beginner
Beginner
Posts: 1
Joined: Wed Jan 16, 2008 1:12 am

List Based Menus

Post by kenlight »

In the extras subdirectory (of the distribution code) are list based menus.

In the example you build a list that is the menu structure, then toward the bottom you assign values to a number of properties such as bordercolor, borderstyle and then call buildlistmenu with the following syntax:
buildListMenu("id of list", "menu style name", "main menu properties")

I am wondering if those properties can be set elsewhere so that it is hidden.
I really don't want to have to put them in each page in my website.

I would rather just be able to include the javascript files at the top (preferably in the header),
build the list based menus with an appropriate id, then make the call to buildlistmenu

Can this be done?

Thanks

Ken Light
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: List Based Menus

Post by Ruth »

Hi,

Try this setup, copy and paste this to a file and save it as listdata.js

Code: Select all

_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;

with(menuStyle=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
fontfamily="Verdana, Tahoma, Arial";
fontsize="75%";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="#eeeeee";
offcolor="#000000";
onbgcolor="#ddffdd";
oncolor="#000099";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=3)";
padding=4;
pagebgcolor="#82B6D7";
pagecolor="black";
separatorcolor="#999999";
separatorsize=1;
subimage="../../arrow.gif";
subimagepadding=2;
}

with(menuStyle2=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
fontfamily="Arial";
fontsize="14px";
fontstyle="normal";
offbgcolor="darkblue";
offcolor="yellow";
onbgcolor="#ffffff";
oncolor="#ff0000";
padding="6px"
}

// syntax: buildListMenu("id of list", "menu style name", "main menu properties")
buildListMenu("milonicmenu1","menuStyle","alwaysvisible=true;orientation='horizontal';top=10;left=10;")
buildListMenu("milonicmenu2","menuStyle2","alwaysvisible=true;orientation='vertical';top=300;left=310;")
buildListMenu("milonicpopupmenu","menuStyle","")
Then copy this and save as this as testlist.htm. Save the two files in the same extras/listbased folder where the other stuff is since the ../milonic stuff is assuming its in that folder.

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>Test Listbased all in files</title>
</head>
<body>
<script type="text/javascript" src="../../milonic_src.js"></script>
<a class=milonic href="https://milonic.com/">JavaScript Menu, DHTML Menu Powered By Milonic</a>
<script type="text/javascript" src="../../mmenudom.js"></script>
<script type="text/javascript" src="listmenus.js"></script>

<ul ID=milonicmenu1>
	<li><a href=index.html title="This is the Milonic Home Page">Home</a></li>
	<li><a href=#>Milonic</a>
	<ul>
		<li><a href="http://websites.milonic.com/milonic.com/cbuy.php>Product Purchasing Page</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/contact.php>Contact Us</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/newsletter.php>Newsletter Subscription</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/menufaq.php>FAQ</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/forum/>Discussion Forum</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/licenses.php>Software License Agreement</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/privacy.php>Privacy Policy</a></li>
	</ul>
	</li>
	<li><a href=#>Partners</a>
	<ul>
		<li><a href=htpp://www.a-q.co.uk/?milonicmenu>(aq) Web Hosting</a></li>
		<li><a href=htpp://www.softidiom.com/?milonicmenu>WebSmith</a></li>
		<li><a href=htpp://www.sms2email.com/?milonicmenu>SMS 2 Email</a></li>
	</ul>
	</li>
	<li><a href=#>Links</a>
	<ul>
		<li><a href="http://websites.milonic.com/apache.org/>Apache Web Server</a></li>
		<li><a href=htpp://www.mysql.com/>MySQL Database Server</a></li>
		<li><a href=htpp://www.php.net/>PHP - Development</a></li>
		<li><a href=htpp://www.phpbb.com/>phpBB Web Forum System</a></li>
		<li><a href=#>Anti Spam Tools</a><ul>
			<li><a href=htpp://www.spamcop.net/>Spam Cop</a></li>
			<li><a href=htpp://www.mimedefang.org/>Mime Defang</a></li>
			<li><a href=htpp://www.spamassasin.com/>Spam Assassin</a></li>
		</ul>
		</li>
	</ul>
	</li>
	<li><a href=#>My Milonic - Other Style</a>
	<ul class=menuStyle2>
		<li><a href="http://websites.milonic.com/milonic.com/login.php>Login</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/mylicenses.php>My Licenses</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/myinvoices.php>My Invoices</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/support/>Make Support Request</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/support/>View Support Requests</a></li>
		<li><a href="http://websites.milonic.com/milonic.com/mydetails.php>Your Details</a></li>
	</ul>
	</li>
</ul>
<script type="text/javascript" src="listdata.js"></script>
</body>
</html>
This will give you a test page to play :). That seems to work OK. Whatever you do, you will lhave to put the listdata.js file, that's the file with the style and the buildList stuff, you will lhave to put that after the ul/li menus on the page since the listbased menu creates itself by reading the list.

Code: Select all

<script type="text/javascript" src="../../milonic_src.js"></script>
<a class=milonic href="https://milonic.com/">JavaScript Menu, DHTML Menu Powered By Milonic</a>
<script type="text/javascript" src="../../mmenudom.js"></script>
<script type="text/javascript" src="listmenus.js"></script>
<script type="text/javascript" src="listdata.js"></script>
Ruth
Post Reply