首页 > 代码库 > Js menu

Js menu

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>menu</title>
<style>
	.menu{
			width:140px;
			height:100px;
			border-color:#33CCFF;
			border-style:solid;
			border-width:1px;
			}
	.functionCss{
			float:left;
			height:34px;
			width:110px;
		}
	.menuImgCss{
			float:left;
			height:34px;
			width:30px;
			}
</style>
<script type="text/javascript">
	 
 
	function selectDiv(obj,div1,div2){
		var d1 = document.getElementById(div1);
		var d2 = document.getElementById(div2);
		d1.style.backgroundColor="#FFFFFF";
		d2.style.backgroundColor="#FFFFFF";
		obj.style.backgroundColor="#B8DCFF";
	}
	function unSelectDiv(obj){

		obj.style.backgroundColor="#FFFFFF";
	}
	function aa() {
		document.getElementById("menu").style.display="block";
	}
	function bb() {
		document.getElementById("menu").style.display="none";
	}
</script>
</head>

<body>

	<div onm ouseover="aa()" onm ouseout="bb()">
		<div>click</div>
		<div id="menu" class="menu" style="display:none">
			<div id="menu1" style="background-color:#B8DCFF">
				<div class="menuImgCss"> 
					<img src=http://www.mamicode.com/"imgs/1.jpg" />>