源码:

1,用隐藏项代替输入项

比如:
<form name="form onSubmit="document.form.str2.value=document.form.str1.value;document.form.str1.value='';">
<input type="text" name="str1">
<input type="hidden" name="str2">
<input type="submit" value="提交">
</form>

取值时只要取 str2 的值就行了,原输入项就不会保留历吏记录

2.>>点击上面的表格,可以看到行渐扩效果

<style>
#tbList th{text-align:left;padding-left:20;border:1px solid white;border-right:1px solid #7994BF;border-bottom:1px solid #7994BF}
#tbList td{padding-left:6;border-top:1px solid white;border-bottom:1px solid #CDD0E1}
</style>
<body style=font-size:12>
<table id=tbList cellpadding=0 cellspacing=0 width=100% style=cursor:default;font-size:12>
    <tr height=25 bgcolor=#C1D1EA>
        <th width=160>寄件人</th>
        <th>主题</th>
        <th width=90>日期</th>
        <th width=90>大小</th>
    </tr>
    <tr height=25>
        <td>关羽</td>
        <td>大意失荆州</td>
        <td>8月7日</td>
        <td>4k</td>
    </tr>
    <tr height=25>
        <td>张飞</td>
        <td>长板坡一吼,吓退十万雄兵</td>
        <td>3月24日</td>
        <td>5k</td>
    </tr>
    <tr height=25>
        <td>赵云</td>
        <td>最帅莫过赵子龙</td>
        <td>3月24日</td>
        <td>3k</td>
    </tr>
</table>
<br>
>>点击上面的表格,可以看到行渐扩效果
</body>
<script>
document.getElementById("tbList").onmousedown=function(e){
    var tb=this,tr,ee
    ee=e==null?event.srcElement:e.target
    if(ee.tagName!="TD")
        return
    tr=ee.parentNode
    if(tb.selRow!=null)
        setTrReveal(tb.selRow,"background:white",1)
    setTrReveal(tr,"background:#EAEAEA")
    tb.selRow=tr
}
function setTrReveal(tr,css,noDelay){
    var i
    if(!document.all)
        return tr.style.cssText+=";"+css
    for(i=0;i< tr.cells.length;i++){
        if(noDelay){
            tr.cells[i].style.cssText+=";"+css
            continue
        }
        tr.cells[i].style.filter="progid:DXImageTransform.Microsoft.RevealTrans(duration=0.5,transition=16)"
        tr.cells[i].filters[0].apply()
        tr.cells[i].style.cssText+=";"+css
        tr.cells[i].filters[0].play()
    }
}
</script>

posted on 2009-03-11 15:23  poop  阅读(286)  评论(0编辑  收藏  举报