Bootstrap Tooltip不是默认值

时间:2014-08-21 21:17:29

标签: javascript html twitter-bootstrap tooltip

<i></i>图标的工具提示,但风格很难看。

http://i.stack.imgur.com/tbMNv.png

我想在这张图片中(默认Bootstrap)

http://i.stack.imgur.com/Ga0ua.png

<script>
$( document ).ready(function() {
    $('.mark-read-button').tooltip();
});
</script>

<i data-toggle="tooltip" data-placement="top" title="Tooltip on top" class="fa fa-circle mark-read-button"></i>

1 个答案:

答案 0 :(得分:0)

尝试使用此代码,它使用CDN和jumbotron来阻止工具提示离开屏幕。

<!-- CDNs -->
<!-- JQuery -->
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- Font Awesome -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<!-- Jumbotron is to stop the tooltip from going off of the screen. -->
<div class="jumbotron">
    <i data-toggle="tooltip" data-placement="top" title="Tooltip on top" class="fa fa-circle mark-read-button"></i>
</div>
<!-- The script cannot be inside another document -->
<script>
  $(document).ready(function(){
    $('[data-toggle="tooltip"]').tooltip();   
});
</script>
相关问题