HTML中如何让局部产生滚动条,并且让滚动条自动滚动到最底部?

看着个示例,下面这个是如何产生局部滚动条,采用的是div来实现
<td vAlign="top" width="100%" height="400">
    <div id="div1" style="OVERFLOW-Y: scroll; WIDTH: 100%; HEIGHT: 100%">
        <TABLE id="Table9" style="BORDER-COLLAPSE: collapse" borderColor="#c0c0ff" cellSpacing="1"
            cellPadding="2" width="100%" border="1">
            <TR>
                <TD class="SmallPartHeader" align="center" colSpan="2">High Level Design History (<asp:label id="lblVersion1" runat="server"></asp:label>)</TD>
            </TR>
            <tr>
                <td id="tdDesignHistory" vAlign="top" runat="server">&nbsp;</td>
            </tr>
        </TABLE>
    </div>
</td>
使用这个语句可以让这个滚动条自动滚动到底部
document.all(‘div1’).scrollTop = document.all(‘div1’).scrollHeight;

JS的东西,有时候还挺有意思的。

This entry was posted in IT技术文章. Bookmark the permalink.

Leave a comment