收縮/展開全文


<!--收縮/展開全文-->
<script type="text/javascript"> 
var mh = 50;//最小高度 
var step = 30;//每次變化的px量 
var ms = 0;//每隔多久循環一次 
function toggle123(o){ 
if (!o.tid)o.tid = "_" + Math.random() * 100; 
if (!window.toggler)window.toggler = {}; 
if (!window.toggler[o.tid]){ 
window.toggler[o.tid]={ 
obj:o, 
maxHeight:o.offsetHeight, 
minHeight:mh, 
timer:null, 
action:1 
}; 
} 
o.style.height = o.offsetHeight + "px"; 
if (window.toggler[o.tid].timer)clearTimeout(window.toggler[o.tid].timer); 
window.toggler[o.tid].action *= -1; 
window.toggler[o.tid].timer = setTimeout("anim('"+o.tid+"')",ms ); 
} 
function anim(id){ 
var t = window.toggler[id]; 
var o = window.toggler[id].obj; 
if (t.action < 0){ 
if (o.offsetHeight <= t.minHeight){ 
clearTimeout(t.timer); 
return; 
} 
} 
else{ 
if (o.offsetHeight >= t.maxHeight){ 
clearTimeout(t.timer); 
return; 
} 
} 
o.style.height = (parseInt(o.style.height, 10) + t.action * step) + "px"; 
window.toggler[id].timer = setTimeout("anim('"+id+"')",ms ); 
} 
window.onload=function(){ 
toggle123(document.getElementById("shoukaiaaa")) 
} 
</script> 
<style type="text/css"> 
div.shoukaisss{border:none 1px;overflow:hidden;} 
div.shoukaisss h5{border:none 1px;border-width:0 0 1px;padding:0;margin:0;height:30px;line-height:30px;cursor:pointer;background:#FFFFFF;color:Black;font-size:large;} 
</style> 
<div class="shoukaisss" id="shoukaiaaa">
<h5 onclick="toggle123(this.parentNode)">
錯誤、更新(展開/縮小)</h5>
<table><tbody>
<tr><td>  這邊是內文這樣
懂了嗎</td></tr>
</tbody></table>
</div>
<!--// 收縮/展開全文-->

留言

本月最夯

偷用電腦,怎知?事件檢視器全記錄!(開機時間、啟動項時間...)