Far*_*had 18 html javascript jquery twitter-bootstrap
试图使Bootstrap显示工具提示功能,我完全按照关于工具提示的Bootstrap DOC并声明我的属性和属性.当我将鼠标悬停在文本上时,数据显示只有函数,但不是像文档中提到的Bootstrap样式.Some tooltip text!alt=""
我采取的步骤来解决此问题:
<Script>$('[data-toggle="tooltip"]').tooltip({'placement': 'top'});</script>标头HTML标记
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/style.css" rel="stylesheet">
<!-- Latest compiled and minified JavaScript -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
HTML标记
<a href="#" data-toggle="tooltip" title="Some tooltip text!">Hover over me</a>
Run Code Online (Sandbox Code Playgroud)
这是一个如何显示的图像.

1_b*_*bug 29
还要记住,Bootstrap Tooltip不喜欢jQuery UI(有一些名称冲突,'tooltip'就是其中之一).
解决方案是更改脚本加载顺序:首先是jQuery UI,之后是bootstrap.js.
jme*_*e11 16
这是适合您的工作模板.我猜错了什么:
以下工作正常.
HTML:
<!DOCTYPE html>
<html lang="en">
<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>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<!-- HTML5 Shim and Respond.js 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="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<a href="#" data-toggle="tooltip" title="Some tooltip text!">Hover over me</a>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script>
$( document ).ready(function() {
$('[data-toggle="tooltip"]').tooltip({'placement': 'top'});
});
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
您的问题很可能是您未能正确初始化工具提示.看看这个bootply
该文件的状态:

HTML:
<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="right" title="Tooltip on right">Tooltip on right</button>
Run Code Online (Sandbox Code Playgroud)
Jquery:
$("[data-toggle=tooltip").tooltip();
Run Code Online (Sandbox Code Playgroud)
bootstrap.min.css和bootstrap.js工具提示正常工作./在路径前添加).