jQuery qTip 不改变类?
你好,我正在使用 qTip 2,我想要 ui-tooltip-dark ui-tooltip-shadow 类,但它没有显示该类。我有这个代码:
$('.selector').qtip({
content: {
text: function(api) {
// Retrieve content from custom attribute of the $('.selector') elements.
return $(this).attr('qtip-content');
}
},
title: {
text: function(api) {
// Retrieve content from ALT attribute of the $('.selector') element
return $(this).attr('alt');
}
},
style: {
classes: 'ui-tooltip-dark ui-tooltip-shadow';
}
});
但是当我把代码放在他们的网站上时,它就
可以工作了,你能告诉我哪里出了问题吗?
编辑
<script type="text/javascript" class="example">
$(document).ready(function()
{
$('.selector').qtip({
content: {
text: function(api) {
// Retrieve content from custom attribute of the $('.selector') elements.
return $(this).attr('qtip-content');
}
},
title: {
text: function(api) {
// Retrieve content from ALT attribute of the $('.selector') element
return $(this).attr('alt');
}
},
style: {
classes: 'ui-tooltip-dark ui-tooltip-shadow';
}
});
});
</script>
Hii i am using qTip 2 i want the class ui-tooltip-dark ui-tooltip-shadow
but it doesnt shows that class. I have this code:
$('.selector').qtip({
content: {
text: function(api) {
// Retrieve content from custom attribute of the $('.selector') elements.
return $(this).attr('qtip-content');
}
},
title: {
text: function(api) {
// Retrieve content from ALT attribute of the $('.selector') element
return $(this).attr('alt');
}
},
style: {
classes: 'ui-tooltip-dark ui-tooltip-shadow';
}
});
But when i put the code that is on their site it works
Can u please tell me where am i going wrong ?
EDIT
<script type="text/javascript" class="example">
$(document).ready(function()
{
$('.selector').qtip({
content: {
text: function(api) {
// Retrieve content from custom attribute of the $('.selector') elements.
return $(this).attr('qtip-content');
}
},
title: {
text: function(api) {
// Retrieve content from ALT attribute of the $('.selector') element
return $(this).attr('alt');
}
},
style: {
classes: 'ui-tooltip-dark ui-tooltip-shadow';
}
});
});
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能只是您发布的内容中的一个拼写错误,但您在内容部分周围缺少一个大括号 -
编辑
试试这个 -
您应该能够看到它在这里工作 - http://jsfiddle.net/KaJ9q/
It might just be a typo in what you've posted but you're missing a curly brace around the content section -
EDIT
Try this -
You should be able to see it working here - http://jsfiddle.net/KaJ9q/