工具提示不显示。只有通常显示在浏览器中的标题正在显示...我该怎么办?为什么不提示jquery在工作
这是我的代码。
HTML代码:
<form action="/validate.php" method="post" id="myform">
<table width="100%" border="1"><tr><td style="max-width:150px;">
<span id="l1" class="label">Username:</span></td><td
style="min-width:500px;"><input type="text" name="username" id="username"
class="input" title="Username must contain only alphabets and numbers"/>
</td></tr><tr><td>
<span class="label" id="l2">Password:</span></td><td><input
type="password" name="pass" id="pass" class="input"/>
</td></tr><tr><td>
<span class="label" id="l3">Repeat password:</span></td><td><input
type="password" name="rep-pass" id="rep-pass" class="input"/>
</td></tr></table>
</form>
的CSS:
.tooltip {
background-color:#000;
border:1px solid #fff;
padding:10px 15px;
width:200px;
display:none;
color:#fff;
text-align:left;
font-size:12px;
-moz-box-shadow:0 0 10px #000;
-webkit-box-shadow:0 0 10px #000;
}
的Jquery:
$(document).ready(function() {
$("#myform :input").tooltip({
position: "center right",
offset: [-2, 10],
effect: "fade",
opacity: 0.7
});
});
工具提示中添加新jQuery UI的1.9版本。你使用什么版本?是否有可能您有早期版本?只是一个猜测。 – War10ck
@ War10ck版本1.8.2请勿使用此版本的此作品 –
,这可能是您正在使用的jQuery的版本号。我使用相同的。 (最新的是1.8.3)。为了使用工具提示,你必须至少有1.9.0版本的jQuery UI。标准的jQuery库没有工具提示。它的UI库包括这些。你可以从[here](http://jqueryui.com/)下载它。 – War10ck