简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.bootcss.com/foundation/5.5.3/css/foundation.min.css"> <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.bootcss.com/foundation/5.5.3/js/foundation.min.js"></script> <script src="https://cdn.bootcss.com/foundation/5.5.3/js/vendor/modernizr.js"></script> <div style="padding:20px"> <h2>简洁的弹窗</h2> <p>要创建一个弹窗可以在 <code> <ul></code> 元素上添加 <code>.clearing-thumbs</code> 类及 <code>data-clearing</code> 属性。在 <code><ul></code> 内添加图片列表。</p> <p>在新窗口打开查看效果更好,打开新窗口 <a target="_blank" href="/r/show/yufei/html/foundation/lightbox">点击这里</a></p> <ul class="clearing-thumbs" data-clearing> <li><a href="/static/i/foundation/rock600x400.jpg"><img src="/static/i/foundation/rock200x100.jpg" width="200" height="100"></a></li> <li><a href="/static/i/foundation/skies600x400.jpg"><img src="/static/i/foundation/skies200x100.jpg" width="200" height="100"></a></li> <li><a href="/static/i/foundation/lights600x400.jpg"><img src="/static/i/foundation/lights200x100.jpg" width="200" height="100"></a></li> </ul> </div> <script> $(document).ready(function() {$(document).foundation();}) </script>
运行结果: