我的代码一直在工作,直到我不知道我修改了什么,我从头开始做了所有事情,但它仍然没有显示工具提示,有人能告诉我代码有什么问题吗?或者更好的是,有没有其他(更简单的)方法来实现工具提示?
<html>
<head>
<link type="text/css" rel="stylesheet" href="css/jquery.qtip.css" />
<title>My site</title>
</head>
<body>
<a href="#">ZA</a>
<div id="jj" style="display: none;">HHHHHHH</div>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery.qtip.js"></script>
<script type="text/javascript">
$('a').qtip({
content: {
text: $('#jj') // Add .clone() if you don't want the matched elements to be removed, but simply copied
}
})
</script>
</body>
</html>发布于 2012-02-01 04:26:05
你不是错过了装货时间吗?
<script type="text/javascript">
$(function() {
$('a').qtip({
content: {
text: $('#jj')
}
});
});
</script>编辑:上面的代码肯定可以工作,请参阅jsfiddle
确保您的qtip.js和qtip.css已加载并且是最新的
发布于 2012-02-01 04:15:50
试着这样做:
$('a').qtip({
content: $('#jj').text()
});或者按照注释所说的做并克隆元素--您可能必须显式地显示它:
$('a').qtip({
content: {
text: $('#jj').clone().show()
}
});发布于 2012-02-01 04:27:01
您需要将qtip javascript放入准备好的文档中。
$(function() {
$('a').qtip({
content: {
text: $('#jj').clone()
}
});
});https://stackoverflow.com/questions/9086178
复制相似问题