在下拉列表框中实现树型菜单(最近在做毕业设计,很棘手,各位帮帮忙) 最好用js实现,最好嫩跟html独立开来,这样就可以重复利用 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你http://www.justrun.net找skytree看看吧 http://www.justrun.net/Product/SkyTree/Examples/Case_FormSelect.asp <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>tree</title><style><!--#foldheader{cursor:hand ; font-weight:bold ;list-style-image:url(fold.gif)}#foldinglist{list-style-image:url(list.gif)}--></style><script language="JavaScript1.2">var head="display:''"img1=new Image()img1.src="fold.gif"img2=new Image()img2.src="open.gif"function change(){ if(!document.all) return if (event.srcElement.id=="foldheader") { var srcIndex = event.srcElement.sourceIndex var nested = document.all[srcIndex+1] if (nested.style.display=="none") { nested.style.display='' event.srcElement.style.listStyleImage="url(open.gif)" } else { nested.style.display="none" event.srcElement.style.listStyleImage="url(fold.gif)" } }}document.onclick=change//--></script><script language="JavaScript1.2"><!--/** * Get cookie routine by Shelley Powers * ([email protected]) */function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) // if cookie exists if (offset != -1) { offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue;}if (get_cookie(window.location.pathname) != ''){ var openresults=get_cookie(window.location.pathname).split(" ") for (i=0 ; i < openresults.length ; i++){ foldinglist[openresults[i]].style.display='' document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImage="url(open.gif)" }}if (document.all){ var nodelength=foldinglist.length-1 var nodes=new Array(nodelength) var openones=''}function check(){ for (i=0 ; i <= nodelength ; i++){ if (foldinglist[i].style.display=='') openones=openones + " " + i } document.cookie=window.location.pathname+"="+openones}if (document.all) document.body.onunload=check//--></script></head><body><ul> <li id="foldheader">News</li> <ul id="foldinglist" style="display:none"> <li><a href="../../../www.cnn.com/index.html">CNN</a></li> <li><a href="../../../www.abcnews.com/index.html">ABC News</a></li> <li><a href="../../../www.vancouversun.com/index.html">Vancouver Sun</a></li> </ul> <li id="foldheader">Games</li> <ul id="foldinglist" style="display:none"> <li><a href="../../../www.gamespot.com/index.html">GameSpot</a></li> <li><a href="../../../www.happypuppy.com/index.html">Happy Puppy</a></li> <li><a href="../../../www.gamecenter.com/index.html">Game Center</a></li> </ul> <li id="foldheader">Software</li> <ul id="foldinglist" style="display:none"> <li><a href="../../../www.download.com/index.html">outer 1</a></li> <li><a href="../../../www.hotfiles.com/index.html">outer 2</a></li> <li id="foldheader">Nested</li> <ul id="foldinglist" style="display:none"> <li><a href="../../../www.windows95.com/index.html">nested 1</a></li> <li><a href="../../../www.shareware.com/index.html">nested 2</a></li> </ul> <li><a href="../../../www.windows95.com/index.html">outer 3</a></li> <li><a href="../../../www.shareware.com/index.html">outer 4</a></li> </ul></ul></body></html><!--1.将以上代码保存到一个记事本当中2.另存为 tree.htm3.双击预览--> 代码中有 2处涉及到图片:1.css中2. event.srcElement.style.listStyleImage="url(open.gif)" 在网上搜索 Dtree 可以很轻松生成一棵树 jquery取指定form中的指定input 从JAVA程序员到JS前端开发 在IE加载一个脚本,在FF加载另一个脚本 未结束的字符串常量js 怎样让某个局部的页面10秒后再显示 如何固定<iframe>在页面中的位置 下拉菜单的Onchange的问题 下拉菜单是用外部.js文件做的,现在想在.JS文件里插入ASP代码,能不能把。JS的内容COPY到.asp里 javascript替换字符串,急急,请高手指点,谢谢!! 大家帮我看一下,如何拖动split条的时候左右内容自适应,有图 我现在一个画面有3M大,怎么才能快速把这个3M大的画面变成一个空白画面. 隐藏/显示页面控件的位置移动问题
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>tree</title>
<style>
<!--
#foldheader{cursor:hand ; font-weight:bold ;list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
-->
</style>
<script language="JavaScript1.2">
var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"function change(){
if(!document.all)
return
if (event.srcElement.id=="foldheader") {
var srcIndex = event.srcElement.sourceIndex
var nested = document.all[srcIndex+1]
if (nested.style.display=="none") {
nested.style.display=''
event.srcElement.style.listStyleImage="url(open.gif)"
}
else {
nested.style.display="none"
event.srcElement.style.listStyleImage="url(fold.gif)"
}
}
}document.onclick=change//-->
</script>
<script language="JavaScript1.2">
<!--
/**
* Get cookie routine by Shelley Powers
* ([email protected])
*/
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).split(" ")
for (i=0 ; i < openresults.length ; i++){
foldinglist[openresults[i]].style.display=''
document.all[foldinglist[openresults[i]].sourceIndex -
1].style.listStyleImage="url(open.gif)"
}
}if (document.all){
var nodelength=foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}function check(){
for (i=0 ; i <= nodelength ; i++){
if (foldinglist[i].style.display=='')
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openones
}if (document.all)
document.body.onunload=check
//-->
</script>
</head>
<body>
<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none">
<li><a href="../../../www.cnn.com/index.html">CNN</a></li>
<li><a href="../../../www.abcnews.com/index.html">ABC News</a></li>
<li><a href="../../../www.vancouversun.com/index.html">Vancouver Sun</a></li>
</ul> <li id="foldheader">Games</li>
<ul id="foldinglist" style="display:none">
<li><a href="../../../www.gamespot.com/index.html">GameSpot</a></li>
<li><a href="../../../www.happypuppy.com/index.html">Happy Puppy</a></li>
<li><a href="../../../www.gamecenter.com/index.html">Game Center</a></li>
</ul> <li id="foldheader">Software</li>
<ul id="foldinglist" style="display:none">
<li><a href="../../../www.download.com/index.html">outer 1</a></li>
<li><a href="../../../www.hotfiles.com/index.html">outer 2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none">
<li><a href="../../../www.windows95.com/index.html">nested 1</a></li>
<li><a href="../../../www.shareware.com/index.html">nested 2</a></li>
</ul>
<li><a href="../../../www.windows95.com/index.html">outer 3</a></li>
<li><a href="../../../www.shareware.com/index.html">outer 4</a></li>
</ul>
</ul>
</body>
</html><!--
1.将以上代码保存到一个记事本当中2.另存为 tree.htm3.双击预览
-->