lz要问啥?!图片当然事先做好滴,
用js控制显隐或者更改图片地址均可实现切换效果!
用js控制显隐或者更改图片地址均可实现切换效果!
解决方案 »
- linux下发布项目无法访问,为什么?
- 各位大虾帮帮忙啊!JS怎么获取鼠标指针所指的DIV的ID值啊?
- 帮忙找错,jquery jsonp
- onkeyup 与onblur冲突
- 单行文本即时显示数据读取的行数~~急!!
- javascript如何解压服务器端压缩的字符串?
- 如何利用预下载图片来呈现?
- 我想 选择了 开始借阅日期 及 借阅结束日期 之后,自动得出 借阅期限 ,你有没有现在的函数?比如:开始日期是:2003-10-10,结束日期
- 对于二维数组得过滤得问题,
- 我不会JAVASCRIPT,我有一个问题,你们应该可以解决!
- 请问这句话是什么意思,执行结果是什么? eval("name=document.all.renyuanname"+id+".value");
- 问个js怎么让一个div在网页的可显示范围垂直居中呢?
<TR ID='JSYD' ParentID='114E' Depth='1' Class='Node-Hidden'><TD title='test' style='padding-left:1em' noWrap='true'><IMG SRC='plus.gif' style="cursor:hand;" onClick=clickNode('JSYD')></IMG> <A href=# onclick=clickNode('JSYD')>test</A></TD></TR>
<TR ID='111' ParentID='JSYD' Depth='2' Class='Node-Hidden'><TD title='test1' style='cursor:hand;padding-left:2em' noWrap='true'>   <A href=#' target='_blank'>test1</A></TD></TR>
<TR ID='112' ParentID='JSYD' Depth='2' Class='Node-Hidden'><TD title='test2' style='cursor:hand;padding-left:2em' noWrap='true'>   <A href=#' target='_blank'>test2</A></TD></TR>
</table>js函数: {
thisRow = document.all.item(id);
if(thisRow)
{
//已经展开
if(thisRow.getAttribute("Expanded") == "yes"){
thisRow.setAttribute("Expanded","no");
thisRow.children(0).children(0).src = "plus.gif";
var allRows = document.all.tags("TR");
for(var i=0;i<allRows.length;i++){
var row = allRows[i];
if(row.getAttribute("ParentID") == id && row.getAttribute("ID") != id){
row.className = "Node-Hidden";
if(row.getAttribute("Expanded") == "yes")
clickNode(row.getAttribute("ID"));
}
}
}
//没有展开
else{
thisRow.setAttribute("Expanded","yes");
thisRow.children(0).children(0).src = "minus.gif";
var allRows = document.all.tags("TR");
for(var i=0;i<allRows.length;i++){
var row = allRows[i];
if(row.getAttribute("ParentID") == id)
row.className = "Node";
}
}
}
}
图片:minus.gif
plus.gif
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<input type="button" id="btnChange" value="Show Baidu Logo" /><br />
<img src="http://www.google.cn/intl/zh-CN/images/logo_cn.gif" alt="google" id="imgTest" />
<script type="text/javascript">
<!--
var oBtn = document.getElementById("btnChange");
var oImg = document.getElementById("imgTest");
oBtn.onclick = function()
{
oImg.src = "http://www.baidu.com/img/logo.gif";
oImg.alt = "baidu";
};
//-->
</script>
</body>
</html>
css里面可以通过背景属性显示+-
css里面可以通过背景属性显示+---------------------------------------大哥麻烦给个例子看看.谢谢.:-)
<head>
<style>
.node{
text-decoration: none ;
}
.open{
cursor: hand ;
background-image : url(minus.gif) ;
background-repeat:no-repeat;
}
.closed{
cursor: hand ;
background-image : url(plus.gif) ;
background-repeat:no-repeat;
}
</style>
</head>
<body>
<a class="node" href="javascript:void('')"><span class="open" onclick="this.className=this.className=='open'?'closed':'open'"> </span></a>
</body>
</html>高 宽等自己调吧 其实怎么实现都一样,能实现就可以了