Bootstrap的js插件之工具提示(tooltip)

data-toggle="tooltip"——指明元素具备工具提示功能;

title——工具提示的具体内容;

data-placement——设置工具提示的具体方位,默认为top;

data-original-title——设置工具提示的原始内容,即title为空时显示在提示框内;

data-html="true"——设置工具提示的title能识别html代码,从而能显示更多信息;

更多细节参考示例:

<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>饭盒儿——发现身边不一样的世界</title>
    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
    <script src="js/jquery-2.1.3.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>

    </style>
</head>
<body>
<div class="container">
    <hr/>
    <p class="muted">
        欢迎下载
        <a href="#" id="mytooltip" data-toggle="tooltip" title="打开身边的不一样的世界" data-placement="right" data-original-title="www.funhere88.com">
            饭盒儿APP
        </a>
    </p>
    <hr/>
    <p>
        <a href="#" data-toggle="tooltip" data-html="true" title="<img src='images/mj.jpg' width='180'>" data-placement="bottom">此处有惊喜</a>
    </p>
</div>
<script>
    $("[data-toggle='tooltip']").tooltip();
//    $("#mytooltip").on("hidden.bs.tooltip",function(e){
//        alert("隐藏了");
//    });
</script>


</body>
</html>



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值