我正在尝试在按钮中显示工具提示,但它仅在第一次悬停时显示。代码如下,
$('.navbar-btn').mouseover(function() {
$(this).tooltip({
trigger: 'hover',
delay: {
show: 200
},
title : $(this).text()
});
});
答案 0 :(得分:0)
db.yourcollection.find({'occupation.company':'Honda','occupation.designation':'manager'})
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Tooltip - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( document ).tooltip();
} );
</script>
<style>
label {
display: inline-block;
width: 5em;
}
</style>
</head>
<body>
<p><label for="age">Your age:</label><input id="age" title="We ask for your age only for statistical purposes."></p>
<p>Hover the field to see the tooltip.</p>
</body>
</html>
参考此链接:
https://jqueryui.com/tooltip/ 试试这个链接答案将是他们的
答案 1 :(得分:0)
你不需要鼠标功能。只需在按钮上附加工具提示即可。
$('.navbar-btn').tooltip({
items: "button",
content: ".",
open: function() {
$(this).tooltip( "option", "content", $(this).text() );
}
});