Foundation - 与 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.tutorialspoint.com, (small)], [https://www.tutorialspoint.com, (medium)], [https://www.tutorialspoint.com, (large)]"></div> <script> $(document).ready(function() { $(document).foundation(); }) </script> </body> </html>
输出
让我们执行以下步骤来查看上述代码的工作原理 −
保存上述 html 代码 use_html.html 文件。
在浏览器中打开此 HTML 文件,将显示如下所示的输出。