在点击悬停时显示工具提示的元素时,我无法弄清楚如何保持工具提示悬停功能。所以基本上我想在每次光标离开元素时隐藏工具提示,无论它是否被点击。
以下是示例:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<button type = " button" class = " btn btn-default" data-toggle = "tooltip"
data-placement = "right" title = "Tooltip on right">Tooltip</button>
<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>
</body>
</html>
答案 0 :(得分:0)
您可以使用jquery来说明当鼠标离开时会失去活动元素的焦点,请参阅下面的代码:
L = 4
N = 2
S = 'aabb' or 'abba'
L = 4
N = 3,4,5
S = impossible
L = 4
N = 6
S = 'aaaa' (palindromes are substrings S[0:2], S[2:4], S[1:3], S[0:3], S[1:4], S[0:4])
我当然只是将ID添加到按钮中以便于测试。