var options = {
animate:true;
title:result.respMsg,
trigger:"click"
};$(#idd).tooltip(options);$(#idd).tooltip('open');代码如上,很简短,我的问题是我看了tooltip的文档后发现并没有animate,title,trigger这几个option。我想知道这几个究竟是怎么起作用的阿?
1 回答
婷婷同学_
TA贡献1844条经验 获得超8个赞
因為...真沒這種用法,查了文檔和源碼都沒找到任何這些參數有用的證據...
實際測試也是真的沒用。
不過對應的方法是這樣
var options = { // animate: true,
show: { effect: "blind", duration: 1000 }, hide: { effect: "explode", duration: 1000 },
// title: result.respMsg,
content: result.respMsg,
// 這個沒辦法直接在 options 中設定,可以綁定 click 事件,來 `open`
// trigger:"click"};想要實現 trigger: click 的話會比較複雜:
<button class="btn">Tooltip</button>
$('.btn').tooltip({ items: '.btn', content: "顯示的內容" });
$('.btn').on({ "click": function() {
$(this).tooltip("open");
}, "mouseout": function() {
$(this).tooltip("disable");
}
});添加回答
举报
0/150
提交
取消
