解决方案 »
- 求JS动态动态创建JSON数据字符串,并且可以删除添加修改!
- 如何让页面[禁止调整大小,包括禁止向下还原],只能最大或最小
- 求一个ExtJs 两个下拉列表(combo)的联动
- object doesn't support this proper or method 错误如何解决
- 有没有像My97DatePicker控件的时间(小时,分,秒)的输入程序
- 如何让一个文本和表单对齐?
- IE6的问题
- 求教如何知道控件的序号
- Jquery 设置 Radio 只有第一次有效?
- easyui 怎么获取dataGrid里面的td标签啊
- 急求 JavaScript 获取iframe内容?急求
- 关于js对像 所接受的事件判定
$(sid).style.display=$(sid).style.display=="none"?"":"none";
} function $(id){
return document.getElementById(id);
}
function show(){
var d = document.getElementById("div1")
if (d.style.display == "none") {
i.style.display = "";
}else{
i.style.display = "none";
}
}
</script>
<span onClick="show()" style="cursor:pointer;"> <img src="images/T.gif" width="18" height="18"> </span>
<DIV id="div1" style="DISPLAY: none">
<%
Response.Write("");
next
%> </DIV>
$(this).click(function(){
if($(this).next().css("display")=="none")
$(this).next().show();
else
$(this).next().hide();
});
});
<script language="JavaScript">
function show(div){ if(div.style.display=="none")
div.style.display="";
}
</script>
</head>
<body>
<span onClick="show(div)" style="cursor:pointer;"> <img src="images/T.gif" width="18" height="18"> </span>
<DIV id="div" style="DISPLAY: none">
werrwrwrwrwrwrwrwrrrwrwrwrerwrwerwerwrwrwrwerwrwerw</DIV>
</body>
</html>
虽然写了个 但真不知道lz想干吗
我的意思是想通过变量赋值给div的ID,然后循环显示父目录下的子目录。额。是这个意思。
-----------------------------------------------
<span onClick="show(i)" style="cursor:pointer;"> <img src="images/T.gif" width="18" height="18"> </span>
<DIV id=i style="DISPLAY: none">
<%
Response.Write("");
next
%> </DIV>
--------------------------------------------------
然后要设置隐藏<div>......</div>这部分的。
把里面的i加上引号.id="i";
onClick="show('i')"
<script language="JavaScript">
function show(i){
//i为div元素的个数
var d ;
for(var j=0;j<i;j++){
//获取div元素对象
d = document.getElementById("div"+(j+1));
//切换div元素的显示
if (d.style.display == "none") {
d.style.display = "";
}else{
d.style.display = "none";
}
}
}
</script>
<span onClick="show()" style="cursor:pointer;"> <img src="images/T.gif" width="18" height="18"> </span>
<DIV id="div1" style="DISPLAY: none">
<%
Response.Write("");
next
%> </DIV>
<DIV id="div2" style="DISPLAY: none">
<%
Response.Write("");
next
%> </DIV>