我只是想选择国家路径来触发工具提示。我怀疑我指的不是 svg 文件中的准确元素。
<script>
$(document).ready(function()
{
$('worldmap.shapes.US').qtip({ content: { text: 'Name: United States<br>Capital: Jefferson City' },
style: {
background: '#000000',
color: '#ffffff',
border: { width: 6, radius: 3, color: '#ff0000' }
},
position: {
corner: {
target: 'topRight',
tooltip: 'bottomLeft'
}
}
});
});
以下是 svg 文件的格式:
worldmap = {
shapes: {
AE: "M604.196,161.643l0.514-0.129l0,0.772l2.188-0.386l2.189,0l1.672,0.129l1.803-1.802l2.058-1.802l1.674-1.673l0.518,0.900l0.385,2.189l-1.417,0l-0.258,1.802l0.517,0.386l-1.159,0.515l-0.129,1.029l-0.773,1.159l0,1.030l-0.514,0.644l-8.110-1.416l-1.031-2.704l0.127,0.643z",
这是一个 .js 文件
谢谢!