Foundation-interchange-html

提供:Dev Guides
移動先:案内検索

基礎-HTMLでのインターチェンジの使用

説明

インターチェンジは、htmlファイルにも使用できます。 HTMLのブロック全体を交換でき、あらゆるタイプの画面サイズでロードされます。

次の例は、Foundationでの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://www.finddevguides.com, (small)],
         [https://www.finddevguides.com, (medium)],
         [https://www.finddevguides.com, (large)]"></div>

      <script>
         $(document).ready(function() {
            $(document).foundation();
         })
      </script>
   </body>
</html>

出力

上記のコードがどのように機能するかを確認するために次の手順を実行してみましょう-

  • 上記のHTMLコード use_htmll ファイルを保存します。
  • このHTMLファイルをブラウザで開くと、次のように出力が表示されます。