码迷,mamicode.com
首页 > Web开发 > 详细

jquery 学习(七) - 常用动态效果

时间:2018-10-30 23:53:58      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:src   htm   动画   cli   学习   anim   mat   ogg   ima   

<!--转载于 听说你的代码很6-->
<!--http://www.jq22.com/webqd2377-->

CSS

    <style>
        #content #first {
            color:white;
            background-color:green;
            width:240px;
            height:100px;
            margin:10px 0 0 0;
            padding:10px;
        }
    </style>

html

    <div id="content">
    <input id="testhide" type="button" value="隐藏">
    <input id="testshow" type="button" value="显示">
    <input id="testtoggle" type="button" value="隐藏/显示">
    <input id="testslideup" type="button" value="上滑隐藏">
    <input id="testslidedown" type="button" value="下滑显示">
    <input id="testslidetoggle" type="button" value="上/下滑显示">
    <input id="testfadein" type="button" value="淡入显示">
    <input id="testfadeout" type="button" value="淡出显示">
    <input id="testfadetoggle" type="button" value="淡入/出显示">
    <input id="testanimate" type="button" value="自定义显示">
    <div id="first">
        想要做一件事,永远都不要怕晚。只要你开始做了,就不晚。而若是你不开始,仅仅停留在思考、犹豫甚至焦虑的状态,那就永远都是零。
    </div>

 

jquery

    <script src="jquery-3.3.1.js"></script>
        <script>
            $(document).ready(function() {
        $("#testhide").click(function() {
            // 动画效果
            $("#first").hide("slow");
        });
        $("#testshow").click(function() {
            // 动画效果
            $("#first").show("slow");
        });
        $("#testtoggle").click(function() {
            // 动画效果
            $("#first").toggle("slow");
        });
        $("#testslideup").click(function() {
            // 动画效果
            $("#first").slideUp("slow");
        });
        $("#testslidedown").click(function() {
            // 动画效果
            $("#first").slideDown("slow");
        });
        $("#testslidetoggle").click(function() {
            // 动画效果
            $("#first").slideToggle("slow");
        });
        $("#testfadein").click(function() {
            // 动画效果
            $("#first").fadeIn("slow");
        });
        $("#testfadeout").click(function() {
            // 动画效果
            $("#first").fadeOut("slow");
        });
        $("#testfadetoggle").click(function() {
            // 动画效果
            $("#first").fadeToggle("slow");
        });
        $("#testanimate").click(function() {
            // 动画效果
            $("#first").animate({
                fontSize: "12px"
            }, "slow");
        });
    });
        </script>

 

jquery 学习(七) - 常用动态效果

标签:src   htm   动画   cli   学习   anim   mat   ogg   ima   

原文地址:https://www.cnblogs.com/Anec/p/9871331.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!