嗨,我使用qTip 2我想要類ui-tooltip-dark ui-tooltip-shadow
,但它不顯示該類。我有這樣的代碼:jQuery qTip不改變類?
$('.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';
}
});
但是當我把那就是在其網站上它的工作原理
u能告訴我的代碼我要去哪裏錯了?
編輯
<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>
請張貼從你說的是工作演示網站的代碼。如果演示中的代碼正在爲你工作,那就用它吧? – Sparky
我修改了它,得到這個,但是它不能正常工作 – kritya
這是我最後一次問這個問題:**請發佈代碼,以便爲你工作**。你說過,「當我把他們的網站上的代碼運行時」_。所以只要在你修改它之前告訴我們什麼「有效」。 – Sparky