Foundation - 交换在 HTML 中使用



描述

Interchange 也可以用于 html 文件。它可以交换完整的 HTML 块,它被加载到所有类型的屏幕尺寸中。

示例

以下示例演示了在 Foundation 中将 interchange 与 HTML 一起使用的方式 -

<!DOCTYPE html>
<html>
   <head>
      <title>Foundation Template</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/foundation.css">
      
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/js/foundation.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script>
   </head>

   <body>
      <h2>Example of use with HTML</h2>
      <div data-interchange = "[https://tutorialspoint.com, (small)], 
         [https://tutorialspoint.com, (medium)], 
         [https://tutorialspoint.com, (large)]"></div>
      
      <script>
         $(document).ready(function() {
            $(document).foundation();
         })
      </script>
   </body>
</html>

输出

让我们执行以下步骤,了解上述给定代码是如何工作的 -

  • 保存上述给定的 html 代码文件 use_html.html

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

foundation_plugins.htm
广告
© . All rights reserved.