目录

fadeOut()

功能

通过淡出的方式隐藏匹配元素。

语法

fx.fadeOut(elm, duration, callback)

参数

范例

Example: 点击段落渐渐消失。

<!DOCTYPE html>
<html>

<head>
    <style>
  p { font-size:150%; cursor:pointer; }
    </style>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.3/require.min.js"></script>
    <script>
    require.config({
        baseUrl: "./",
        packages: [{
            name: "skylark",
            location: "../../../src/skylark"
        }, ]
    });
    </script>
</head>

<body>
    <p>
  If you click on this paragraph
  you'll see it just fade away.
  </p>
    <script>
    require(["skylark/query", "skylark/finder", "skylark/fx"], function(query,finder, fx) {
       query("p").on("click", function() {
            fx.fadeOut(finder.find("p"),"slow");
        });
    });
    </script>
</body>

</html>