【发布时间】:2016-08-10 17:31:06
【问题描述】:
我需要配置工具提示以在链接悬停后显示链接, 但是我无法通过 title 属性提取任何 html。
代码如下:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="js/tooltipster.bundle.min.js"></script>
<link href="css/tooltipster.bundle.min.css" rel="stylesheet" />
</head>
<body>
<img src="img/plus-ico.png" class="tooltip" title="content that is displayed in tooltip without link" />
<a href="link_to_other_content_or_page">Link which is preffered in tooltip</a>
<img src="img/1.jpg" />
<script>
$(document).ready(function(){
$('.tooltip').tooltipster({
interactive: true,
contentAsHTML: true
//I tried above option contentAsHTML and and adding <a href="#"> to title attribute but i think its depreciated.
});
});
</script>
</body>
【问题讨论】:
标签: jquery plugins jquery-plugins tooltip