<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www./TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www./1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>简单的树菜单</title> <script type="text/javascript"> var c = null; function show(d1){ var o = document.getElementById(d1); if(o != null){ if(o.style.display == 'none'){ o.style.display = 'block'; if(c && c != o){ c.style.display = 'none'; } c = o; }else{ o.style.display = 'none'; } } return false; } </script> <style type="text/css"> <!-- ul { list-style-image: none; list-style-type: none; } --> </style> </head> <body> <div> <ul> <li style="width:100px;height:25px; background-color:#cccccc;"><a href="" onclick="return show('b')">流行语言</a></li> <li id="b" style="width:100px;height:100px; background-color:#666666; display:none;">ASP</li> <li style="width:100px;height:25px; background-color:#cccccc;"><a href="" onclick="return show('c')">经典语言</a></li> <li id="c" style="width:100px;height:100px; background-color:#666666; display:none;">php</li> <li style="width:100px;height:25px; background-color:#cccccc;"><a href="" onclick="return show('d')">移动开发</a></li> <li id="d" style="width:100px;height:100px; background-color:#666666; display:none;">Android</li> </ul> </div> </body> </html>
|
|
来自: crystyleEye > 《html》