BootWiki教程网
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bootstrap 实例 - 弹出框(Popover)插件</title> <link href="//cdn.staticfile.net/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <script src="//cdn.staticfile.net/jquery/2.1.1/jquery.min.js"></script> <script src="//cdn.staticfile.net/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container" style="padding: 100px 50px 10px;" > <button class="btn btn-default" data-container="body" data-content="左侧的 Popover 中的一些内容" data-placement="left" data-toggle="popover" title="Popover title" type="button"> 左侧的 Popover </button> <button class="btn btn-primary" data-container="body" data-content="顶部的 Popover 中的一些内容" data-placement="top" data-toggle="popover" title="Popover title" type="button"> 顶部的 Popover </button> <button class="btn btn-success" data-container="body" data-content="底部的 Popover 中的一些内容" data-placement="bottom" data-toggle="popover" title="Popover title" type="button"> 底部的 Popover </button> <button class="btn btn-warning" data-container="body" data-content="右侧的 Popover 中的一些内容" data-placement="right" data-toggle="popover" title="Popover title" type="button"> 右侧的 Popover </button> </div> <script> $(function () { $("[data-toggle='popover']").popover(); }); </script> </body> </html>
运行结果