如何将jQueryUI与我的自定义css一起使用
How to use jQueryUI tootip along with my custom css
我正在使用jQueryUI工具提示&自定义css来格式化它。Tooltip即将到来,但无法在上面应用我的css类。代码:
$(document).ready(function () {
$("#roles").tooltip({ content: "Start typing a name for the IT role you're staffing. There are 75 to choose from. If you're uncertain, start with something general like '<i>Manager</i>'" });
});
HTML
<input id="roles" type="text" class="wGridPx_16"/>
CSS
<style>
.ui-tooltip
{
font-size: 11px;
color: #fff;
text-shadow: 0 0 2px #000;
padding: 4px 8px;
border: 1px solid rgba(255,255,255,0.25);
background-color: rgb(25,25,25);
background-color: rgba(25,25,25,0.82);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000));
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
box-shadow: 0 0 3px #555;
-webkit-box-shadow: 0 0 3px #555;
-moz-box-shadow: 0 0 3px #555;
}
</style>
请帮忙。我已经查看了很多关于它的问答博客,比如页面加载上的jquery ui工具提示自定义类,但对我没有任何帮助
您可以使用tooltipClass选项
$(document).ready(function () {
$("#roles").tooltip({
content: "Start typing a name for the IT role you're staffing. There are 75 to choose from. If you're uncertain, start with something general like '<i>Manager</i>'",
tooltipClass: 'my-class'
});
});
然后
.my-class.ui-tooltip {
font-size: 11px;
color: #fff;
text-shadow: 0 0 2px #000;
padding: 4px 8px;
border: 1px solid rgba(255, 255, 255, 0.25);
background-color: rgb(25, 25, 25);
background-color: rgba(25, 25, 25, 0.82);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000));
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
box-shadow: 0 0 3px #555;
-webkit-box-shadow: 0 0 3px #555;
-moz-box-shadow: 0 0 3px #555;
}
演示:Fiddle
相关文章:
- 将jQuery.css()与变量一起使用
- 我的HTML、CSS和Javascript应该放在一起还是分开
- 为什么我的css文件不能与MCV项目一起使用
- HTML/Javascript/CSS框堆叠在一起
- 如何将(CSS/HTML)的包链接在一起.CSS/HTML->CSS/HTML->CSS/HTML
- 如何使用内容脚本将另一个html连同css文件一起注入到html中
- 在Jquery中将$(this)与css类选择器一起使用
- 如何将jQueryUI与我的自定义css一起使用
- CSS 不能与 NodeJS 一起使用
- Angular 和 Animate.css - 一起使用时不显示正确的信息
- CSS 缩放在起点和终点之间与 javascript 一起使用
- 如何将CSS与javascript一起使用
- 将不同的 CSS 与多个猫头鹰轮播一起使用
- 将 css 和 javascript 与 Web 表单捆绑在一起
- 让 js 和 css 与 Ratchet 的 push.js 一起工作
- 如何将图像链接与 HTML 和 CSS 一起使用时,悬停时在其他位置显示图像
- 如何将 fadeIn 与 css 属性更改 jquery 一起使用
- Jquery隐藏不与css动画一起使用
- Javascript/jQuery不能与我的html和css一起工作
- 如何在JavaScript中创建两个表并与不同的CSS一起使用