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>
    
    
  • 相关阅读:
    2019-05-07
    2019-04-28 问题记录
    2019-04-15 python深浅复制
    2019-04-11 统计日志重复数量
    2019-03-23 shell练习,日志统计
    问题记录2019-03-12
    问题记录2019-03-06(todo)
    回归
    Mac进行 usr/bin 目录下修改权限问题,operation not permitted
    个人的随笔心情
  • 原文地址:https://www.cnblogs.com/chenqingwei/p/1691423.html
Copyright © 2011-2022 走看看