zoukankan      html  css  js  c++  java
  • jquery简单动画

    自定义滑入滑出动画

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
        <script src="js/jquery-1.7.1.min.js"></script>
        <style>
    
            .a {
            float:left;
            100px;
            height:40px;
            background-color:darkblue;
            overflow:hidden;
            margin-left:20px;
            }
            .b {
            100px;
    
            top:40px;
            position:relative;
            background-color:yellow;
            }
        </style>
    
    
    </head>
    <body>
        <form id="form1" runat="server">
        <div class="a">
            <div class="b" style="height:50px;"></div></div>
            <div class="a">
            <div class="b" style="height:100px;"></div></div>
            <div class="a">
            <div class="b" style="height:200px;"></div></div>
            <div class="a">
            <div class="b" style="height:300px;"></div></div>
            <div class="a">
            <div class="b" style="height:400px;"></div></div>
            <div class="a">
            <div class="b" style="height:500px;"></div></div>
    
        </form>
    </body>
    </html>
    <script>
        $(".a").hover(function () {
            var s = $(this).children($(".b:first")).height();//animate:自定义动画
            $(this).stop().animate({"height":(s+40)},500);//stop():停止动画,防止动画积累
    
        }, function () {
            $(this).stop().animate({ "height": "40px" }, 500);
        });
    
    
    
    </script>
    View Code
  • 相关阅读:
    Groovy Urlencode编码
    PowerShell导入自定义公共函数
    Groovy获取对象类型、属性
    adb名称操作模拟器
    《坚不可摧》——乔布斯演讲
    马拉松节奏跑(转载)
    马拉松配速
    什么是思考力三要素?(转载)
    Python解析JSON为实体
    excel宏的用法
  • 原文地址:https://www.cnblogs.com/wwz-wwz/p/6050001.html
Copyright © 2011-2022 走看看