Foundation - Motion UI 过渡



描述

Foundation 通过使用 Motion UI 库创建的过渡类来提供过渡效果。

示例

以下示例演示了在 Foundation 中使用转换

<!doctype html>
   <head>
      <meta charset = "utf-8" />
      <meta http-equiv = "x-ua-compatible" content = "ie = edge" />
      <meta name = "viewport" content = "width = device-width, initial-scale = 1.0" />
      
      <title>Motion UI Transition</title>
      
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/motion-ui/1.1.1/motion-ui.css">
      
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
   </head>

   <body>
      <h2>Motion UI Transition Example</h2>
      <p><a data-toggle = "toggle_panel">Click here to toggle the panel</a></p>
      
      <div class = "callout" id = "toggle_panel" data-toggler data-animate = "hinge-in-from-bottom spin-out">
         <h2>Foundation</h2>
         <p>Foundation is semantic, readable, flexible, and completely customizable.</p>
      </div>
      
      <script>
         $(document).ready(function() {
            $(document).foundation();
         })
      </script>
   </body>
</html>

输出

让我们执行以下步骤,看看上面给定的代码是如何工作的 −

  • 保存以上给定的 html 代码foundation_transitions.html文件。

  • 在浏览器中打开此 HTML 文件,显示如下输出。

foundation_motion_ui.htm
广告