通过淡出的方式隐藏匹配元素。
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>