我想知道如何在悬停时显示 svg 路径标题?
$( "path" ).click(function() {
$("#country").val($(this).attr('title'));
$( "#target" ).submit();
});
一些 SVG 代码:
<path id="IE-CW" title="Carlow" class="land" d="M458.79,501.13L460.38,501.38L461.8,500.65L463.58,502.11L463.79,502.83L464.9L457.76,504.49L457.53,501.71L458.46,501.86z"/>
最佳答案
Instead of using title attribute, use a nested title element.
Use the below code:
<path id="IE-CW" title="Carlow" class="land" d="M458.79,501.13L460.38,501.38L461.8,500.65L463.58,502.11L463.79,502.83L464.9L457.76,504.49L457.53,501.71L458.46,501.86z">
<title>Carlow</title>
</path>
关于jquery - 使用 jquery 在 Hover 中显示路径标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43673227/