此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【goodadd】截止到2008-07-05 23:44:23的历史汇总数据(不包括此帖):
发帖的总数量:2 发帖的总分数:120
结贴的总数量:2 结贴的总分数:120
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:0.00 % 无满意结分率:0.00 %
敬礼!
楼主【goodadd】截止到2008-07-05 23:44:23的历史汇总数据(不包括此帖):
发帖的总数量:2 发帖的总分数:120
结贴的总数量:2 结贴的总分数:120
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:0.00 % 无满意结分率:0.00 %
敬礼!
解决方案 »
- 如何获取到alert的的显示值
- 天猫商品分类随鼠标滑轮滚动自动展开关闭效果怎么实现的?
- JS瀏覽器(IE,firefox,google)兼容性問題
- 请问jquery插件中的()(jquery)怎么理解?
- 菜鸟级问题,怎样获得复选框旁边的文本,什么属性?
- 脑筋急转弯问题,俺不能理解,大家帮忙看一下.
- 问一个问题
- js中异步请求的问题
- 我作新闻系统,显示新闻标题的时候,有的过长,我想只显示20字节(注意,是字节,汉字占两个字节),怎么实现
- 提问:如何在servlet中调用ORACLE的PL/SQL的存储过程
- 如何focus在textbox中最后一个字符的后面
- 求解:onMouseOver 下拉菜单在页面有内容的情况下经常不能随鼠标离开而自动消失
JSONArray方式从新写一个支持多结点的,到时候再和大家分享。
(代码功能,这是一个分类树,通过点击节点将分类名和编号传递回来)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>test</title>
<style type="text/css">
<!--
body {
background-color: #C4CDD9;
}
body,td,th {
font-size: 12px;
}
#containerul, #containerul ul{
text-align:left;
margin:0;
padding:0;
}
#containerul li{
margin:0 0 0 30px;
padding:0;
list-style-type:none;
}
#containerul .symbols{
float:left;
width:12px;
height:1em;
background-position:0 50%;
background-repeat:no-repeat;
}
.modalDiv{
width:311px;
height:274px;
}
.modalheader{
margin:2px;
padding:2px;
}
.header{
margin:0;
padding:0;
}
.mleft{
width:280px;
float:left;
}
.mright{
float:right;
}
.modalbody{
margin:10px;
padding:2px;
color:blue;
}
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
var temp, temp2, cookieArray, cookieArray2, cookieCount;function initiate(){
cookieCount=0;
if(document.cookie){
cookieArray=document.cookie.split(";");
cookieArray2=new Array();
for(i in cookieArray){
cookieArray2[cookieArray[i].split("=")[0].replace(/ /g,"")]=cookieArray[i].split("=")[1].replace(/ /g,"");
}
}
cookieArray=(document.cookie.indexOf("state=")>=0)?cookieArray2["state"].split(","):new Array();
temp=document.getElementById("containerul");
for(var o=0;o<temp.getElementsByTagName("li").length;o++){
if(temp.getElementsByTagName("li")[o].getElementsByTagName("ul").length>0){
temp2 = document.createElement("span");
temp2.className = "symbols";
temp2.style.backgroundImage = (cookieArray.length>0)?((cookieArray[cookieCount]=="true")?"url(images/minus.png)":"url(images/plus.png)"):"url(images/plus.png)";
temp2.onclick=function(){
showhide(this.parentNode);
writeCookie();
}
temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild)
temp.getElementsByTagName("li")[o].getElementsByTagName("ul")[0].style.display = "none";
if(cookieArray[cookieCount]=="true"){
showhide(temp.getElementsByTagName("li")[o]);
}
cookieCount++;
}
else{
temp2 = document.createElement("span");
temp2.className = "symbols";
temp2.style.backgroundImage = "url(images/page.png)";
temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild);
}
}
}function showhide(el){
el.getElementsByTagName("ul")[0].style.display=(el.getElementsByTagName("ul")[0].style.display=="block")?"none":"block";
el.getElementsByTagName("span")[0].style.backgroundImage=(el.getElementsByTagName("ul")[0].style.display=="block")?"url(images/minus.png)":"url(images/plus.png)";
}function writeCookie(){ // Runs through the menu and puts the "states" of each nested list into an array, the array is then joined together and assigned to a cookie.
cookieArray=new Array()
for(var q=0;q<temp.getElementsByTagName("li").length;q++){
if(temp.getElementsByTagName("li")[q].childNodes.length>0){
if(temp.getElementsByTagName("li")[q].childNodes[0].nodeName=="SPAN" && temp.getElementsByTagName("li")[q].getElementsByTagName("ul").length>0){
cookieArray[cookieArray.length]=(temp.getElementsByTagName("li")[q].getElementsByTagName("ul")[0].style.display=="block");
}
}
}
document.cookie="state="+cookieArray.join(",")+";expires="+new Date(new Date().getTime() + 365*24*60*60*1000).toGMTString();
}
function ShowModal(dname,id,jd)
{
var showDiv=document.getElementById(dname+'Text');
var objDiv=document.getElementById('objText');
var disable=document.getElementById('disableDiv');
var leibie=document.getElementById('lb');
var leibieID=document.getElementById('lbID');
if(showDiv.style.display=='none'
{
showDiv.style.display='block';
disable.style.display='block';
showDiv.innerHTML=objDiv.innerHTML;
initiate();
}else{
showDiv.style.display='none';
disable.style.display='none';
leibie.value=jd;
leibieID.value=id.toString();
}
}
//-->
</SCRIPT>
</head>
<body>
<input type="text" name=leibie id="lb" value="点击选择分类" onClick="ShowModal('show');">
<input type="text" name=leibieID id="lbID">
<div id="showText" class="modalDiv" style="position:absolute;left:300px; top:10px;z-index:2;display:none;">
</div>
<div id="disableDiv" style="position:absolute; left:0px; top:0px; width:100%; height:100%; z-index:1; background-
color:#ffffee; border: 0px none #000000; FILTER:alpha(opacity=50);display:none;">
</div>
<div id="objText" style="display:none;">
<ul id="containerul">
<li id="li">
所有分类
<ul id="ul">
<!-- 自定义标签 -->
<li id="li"><a href="javascript:ShowModal('show',73,'设备资源');">设备资源</a><ul id="ul">
<li id="li"><a href="javascript:ShowModal('show',74,'机械设备');">机械设备</a><ul id="ul">
</ul></li>
</ul></li>
<li id="li"><a href="javascript:ShowModal('show',75,'软件资源');">软件资源</a><ul id="ul">
</ul></li>
<li id="li"><a href="javascript:ShowModal('show',76,'科技信息');">科技信息</a><ul id="ul">
<li id="li"><a href="javascript:ShowModal('show',77,'科技信息');">科技信息1</a><ul id="ul">
<li id="li"><a href="javascript:ShowModal('show',78,'科技信息2');">科技信息2</a><ul id="ul">
</ul></li>
</ul></li>
</ul></li>
</ul>
</li>
</ul>
</div>
</body>
</html>