zoukankan      html  css  js  c++  java
  • 利用jquery实现内容回滚

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="jQueryApplication._Default" %>
    
    <!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 runat="server">
        <title></title>
        <script type="text/javascript" src="http://ajax.goolgeapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">
        </script>
        <script type="text/javascript">
            $(function() {
                var $tb = $('textarea[id$=tb1]');
                $('input[id$=btnScroll]').toggle(
                function(e) {
                    e.preventDefault();
                    scrollArea($tb, $tb[0].scrollHeight);
                },
                function(e) {
                    e.preventDefault();
                    scrollArea($tb, 0);
                });
            });
    
            function scrollArea(ctrl, ht) {
                ctrl.animate({scrollTop: ht},1000);
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div >
            <asp:TextBox ID="tb1" runat="server" TextMode="MultiLine" Text="asfasf  asfasfasfasf  asfasfasfasf  asfasfasfasf  asfasfasfasf  asfasfasfasf  asfasfasfasf  asfasfasfasf  asfasfasfasf  asfasfasfasf  asfasf"
                rows ="5"></asp:TextBox>
            <br />
            <asp:Button runat="server" Text="scroll" ID="btnScroll" />
        </div>
        </form>
    </body>
    </html>
    
    
  • 相关阅读:
    exit()和_exit()函数(转)
    C语言struct内存占用问题 (转)
    C语言中memset函数(转)
    STDIN_FILENO与stdin区别(转)
    stderr,strerror,errno,perror,论坛大神的回答!
    C++ 函数模版
    C++ 内置函数
    offsetof
    LockSupportDemo
    读写锁,await和signa
  • 原文地址:https://www.cnblogs.com/chenqingwei/p/1691423.html
Copyright © 2011-2022 走看看