表单元素样式上的jquery工具提示未显示
我基于实现了工具提示。 我看到了工具提示,但没有样式。样式表中的内容似乎不能正常工作 我的代码: JS表单元素样式上的jquery工具提示未显示,jquery,Jquery,我基于实现了工具提示。 我看到了工具提示,但没有样式。样式表中的内容似乎不能正常工作 我的代码: JS // select all desired input fields and attach tooltips to them $("#edit_foto_form :input").tooltip({ // place tooltip on the right edge position: "center right", // a
// select all desired input fields and attach tooltips to them
$("#edit_foto_form :input").tooltip({
// place tooltip on the right edge
position: "center right",
// a little tweaking of the position
offset: [-2, 10],
// use the built-in fadeIn/fadeOut effect
effect: "fade",
// custom opacity setting
opacity: 0.7
});
/* simple css-based tooltip */ .tooltip {
background-color:#000;
border:1px solid #fff;
padding:10px 15px;
width:200px;
display:none;
color:#fff;
text-align:left;
font-size:12px;
/* outline radius for mozilla/firefox only */
-moz-box-shadow:0 0 10px #000;
-webkit-box-shadow:0 0 10px #000;
}
CSS
// select all desired input fields and attach tooltips to them
$("#edit_foto_form :input").tooltip({
// place tooltip on the right edge
position: "center right",
// a little tweaking of the position
offset: [-2, 10],
// use the built-in fadeIn/fadeOut effect
effect: "fade",
// custom opacity setting
opacity: 0.7
});
/* simple css-based tooltip */ .tooltip {
background-color:#000;
border:1px solid #fff;
padding:10px 15px;
width:200px;
display:none;
color:#fff;
text-align:left;
font-size:12px;
/* outline radius for mozilla/firefox only */
-moz-box-shadow:0 0 10px #000;
-webkit-box-shadow:0 0 10px #000;
}
HTML
<div id="content">
<h1 class="top">Update Foto</h1>
<form action="" method="post" id="edit_foto_form" enctype="multipart/form-data">
<input type="hidden" name="action" value="update_foto" />
<label for="file">Foto:</label>
<input type="file" name="fotofile" id="fotofile" title="Bitte Foto 100 x 100, größere werden angepasst."><br>
<span></span>
<br />
<label> </label>
<input type="submit" value="Hochladen" />
<br />
</form>
</div
更新Foto
福托:
将JS代码放入:(document.ready)
$(函数(){
//你的JS代码
});
Jquery工具提示似乎不适用于input type=“file”
。我使用了您的代码,只是更改了type=“text”
,它工作正常
您可以在此处看到演示:
您需要包括jqueryTools。您只包括了jquery、jquery UI和jquery验证。将其添加到HTML中
问题在于我在一个函数中同时放置了表单验证和工具提示。在创建了两个单独的函数之后,所有功能都可以正常工作。再次感谢您提供的所有提示。您是否在HTML中包含了jquery工具?您还应该修复div end标记,除非这是一个复制/粘贴错误。请在示例我看到它对两者都有效。至少在FF中是这样。在我的例子中,工具提示显示,但没有css格式。这是您需要的链接。