Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

Need someone to turn a regular css navigation menu into a drop down menu

Status
Not open for further replies.
Joined
Jan 11, 2007
Posts
5,065
Reaction score
106
Need someone to turn a regular css menu into a drop down menu with javascript.

The current naviagtion menu is here:

www.gercia.com/menu

Need someone to turn it into a drop down menu.

Please PM me if you can do this
 
I really need to carry on the same style as the original menu
 
have a go with this.. the associated css will need a bit of work to match yours.. but should be a good starting point for you..

java for head tag:
Code:
<script type="text/javascript">
<!--
window.onload=show;
function show(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}
//-->
</script>


menu code:
Code:
<div id="menu">
	<dl>
		<dt onmouseover="javascript:show();"><a href="" title="Return to home">Home</a></dt>
	</dl>
	
	<dl>			
		<dt onmouseover="javascript:show('smenu1');">Menu 1</dt>
			<dd id="smenu1">
				<ul>
					<li><a href="#">sub-menu 1.1</a></li>
					<li><a href="#">sub-menu 1.2</a></li>
					<li><a href="#">sub-menu 1.3</a></li>
					<li><a href="#">sub-menu 1.4</a></li>
					<li><a href="#">sub-menu 1.5</a></li>
					<li><a href="#">sub-menu 1.6</a></li>
				</ul>
			</dd>
	</dl>
	
	
	<dl>	
		<dt onmouseover="javascript:show();"><a href="">Menu 2</a></dt>
	</dl>
	
	<dl>	
		<dt onmouseover="javascript:show('smenu3');">Menu 3</dt>
			<dd id="smenu3">
				<ul>
					<li><a href="#">sub-menu 3.1</a></li>
					<li><a href="#">sub-menu 3.2</a></li>
					<li><a href="#">sub-menu 3.3</a></li>
					<li><a href="#">sub-menu 3.4</a></li>
					<li><a href="#">sub-menu 3.5</a></li>
				</ul>
			</dd>
	</dl>
	
	<dl>	
		<dt onmouseover="javascript:show('smenu4');">Menu 4</dt>
			<dd id="smenu4">
				<ul>
					<li><a href="#">sub-menu 4.1</a></li>
					<li><a href="#">sub-menu 4.2</a></li>
					<li><a href="#">sub-menu 4.3</a></li>
				</ul>
			</dd>
	</dl>
	
</div>

css code:

Code:
body {
margin: 0;
padding: 0;
background: white;
font: 80% verdana, arial, sans-serif;
}
dl, dt, dd, ul, li {
margin: 0;
padding: 0;
list-style-type: none;
}
#menu {
position: absolute; /* Menu position that can be changed at will */
top: 0;
left: 0;
z-index:100;
width: 100%; /* precision for Opera */
}
#menu dl {
float: left;
width: 12em;
}
#menu dt {
	cursor: pointer;
	text-align: center;
	font-weight: bold;
	background: #000;
	border: 1px solid red;
	margin: 0px;
	color: #FFFFFF;
	

}
#menu dd {
display: none;
border: 1px solid red;

}
#menu li {
text-align: center;
background: #000;
}
#menu li a, #menu dt a {
color: #FFFFFF;
text-decoration: none;
display: block;
height: 100%;
border: 0 none;
}
#menu li a:hover, #menu li a:focus, #menu dt a:hover, #menu dt a:focus {
background: red;

}
#site {
position: absolute;
z-index: 1;
top : 70px;
left : 10px;
color: #000;
background-color: #ddd;
padding: 5px;
border: 1px solid red; 
}
 
Status
Not open for further replies.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

Latest Comments

Upcoming events

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom