zoukankan      html  css  js  c++  java
  • [ jquery 效果 fadeIn([speed,[easing],[fn]]) fadeOut([speed,[easing],[fn]]) ] 此方法用于通过不透明度的变化来实现所有匹配元素的淡入效果,并在动画完成后可选地触发一个回调函数

    fadeIn([speed],[easing],[fn]):

      通过不透明度的变化来实现所有匹配元素的淡入效果,并在动画完成后可选地触发一个回调函数,这个动画只调整元素的不透明度,也就是说所有匹配的元素的高度和宽度不会发生变化

    fadeOut([speed],[easing],[fn]):

      通过不透明度的变化来实现所有匹配元素的淡出效果,并在动画完成后可选地触发一个回调函数,这个动画只调整元素的不透明度,也就是说所有匹配的元素的高度和宽度不会发生变化

    实例:

    <html lang='zh-cn'>
    <head>
    <title>Insert you title</title>
    <meta http-equiv='description' content='this is my page'>
    <meta http-equiv='keywords' content='keyword1,keyword2,keyword3'>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type='text/javascript' src='./js/jquery-1.12.1.min.js'></script>
    <style type="text/css">
        *{margin:0;padding:0;}
        html{font:400 15px/1.2em 'Courier New';color:#666;750px;margin:25px auto;}
        #show{250px;height:400px;background:red;display:none;color:#FFF;line-height:400px;text-indent:8px;padding:10px 30px;margin:70px;text-align:center;}
        button{padding:8px;border:0;outline:none;background:#00E92C;border-radius:2px;}
        .wrapAll{color:#FF96EC;}
    </style>
    <script type='text/javascript'>
        $(function(){
            $('button').click(function(){
                $('#show').fadeIn(1000,'linear',function(){
                    $(this).fadeOut(5000,'swing',function(){
                        /*
                            fadeIn fadeOut 只是通过改变目标的透明度来实现动画效果
                        */
                        console.log('fade animate already Finished...');
                    });
                });
            });
        });
    </script>
    </head>
    <body>
        <div id='demo'>
            <button type="button">button</button>
            <div id='show'>Test text</div>
        </div>
    </body>
    </html>
  • 相关阅读:
    csrf攻击 使用js 调用 php文件的方法(还没实践)
    优化 要引入多个 模块 使用调用的方法,让管理更便捷 --execfile() 函数
    自动化 数据分离 --A文件里面的类 中的函数 调用 B文件里面类 的函数 的方法
    断言文件-封装方法 和 思路
    appium 元素文件 -查找元素 封装思路和方法
    appium的log详细分析
    链接多个数据库的方法
    修改phpMYadmin 链接其他数据库地址的方法
    搜索字段-预约时间
    用过的sql 工具
  • 原文地址:https://www.cnblogs.com/mysearchblog/p/5619257.html
Copyright © 2011-2022 走看看