原图是
我点击向下的三角形向下的图片后,展开下面的图片中的效果我应该怎么写?
求大神jQuery
我点击向下的三角形向下的图片后,展开下面的图片中的效果我应该怎么写?
求大神jQuery
解决方案 »
- 一个javascript幻灯片无法显示的问题,什么原因??
- js 时间间隔求实现
- 我多次见过这样的下载站,谁能帮我找找源码
- 层显示图片问题
- 怎样才能在可以跨域进行javascript操作?
- <求助>用javascript生成XML文件时用createProcessingInstruction()创建头文件时出现的问题?
- 这句话提示错误不知道是哪个地方出现错误,请求支援!!!!解决给100分啊
- 一个小问题
- 这个怎么着?请高手帮忙?
- 连接wss,浏览器提示ERR_CERT_AUTHORITY_INVALID
- 关于标签页的问题
- jsp的button onclick事件 如何传带html标签的参数给js
我的意思是展开的黄色区域
我写table,结果是下面单元格全乱了,
写div层,在firebug下看也不在大的table中
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
table{ border-collapse:collapse; }
td{
border:1px solid #ccc;
}
.detailed td{
background:#ebb;
}
#bntTd{
width:100px;
}
.hide{ display:none }
#bntTd.show{
background:#ebb;
border-bottom-color:#ebb;
}
</style>
</head>
<body>
<table width="100%" id="tab1" >
<tr>
<td id="bntTd" > <button onclick="show(this)">bnt</button> </td>
<td> </td>
<td> </td>
</tr>
<tr class="detailed hide" >
<td colspan="3" >
1<br/>
2<br/>
</td>
</tr>
<tr>
<td id="bntTd"> <button onclick="show(this)">bnt</button> </td>
<td> </td>
<td> </td>
</tr>
<tr class="detailed hide">
<td colspan="3" >
1<br/>
2<br/>
</td>
</tr>
</table> <script>
function show(el){
var tb=document.getElementById('tab1');
var td=el.parentNode;
var detailed=tb.rows[td.parentNode.rowIndex+1];
if(td.className=='show'){
td.className='';
detailed.className='detailed hide';
}else{
td.className='show';
detailed.className='detailed'; }
}
</script>
</body>
</html>