},
// 特效
effect: function(api, pos, viewport) {
$(this).animate(pos, {
duration: 200,
queue: FALSE
});
}
},
// 显示提示的相关设置
show: {
// 触发事件的目标元素
// 默认为选择器
target: false,
// 事件名称,默认为鼠标移到时
// 可以改为click点击
event: ‘mouseenter’,
// 特效
effect: true,
// 延迟显示时间
delay: 90,
// 隐藏其他提示
solo: false,
// 在页面加载完就显示提示
ready: false,
modal: {
// 启用模态对话框效果
on: false,
// 特效
effect: true,
blur: true,
escape: true
}
},
// 隐藏提示的相关设置
// 参考show
hide: {
target: false,
event: ‘mouseleave’,
effect: true,
delay: 0,
// 设置为true时,不会隐藏
fixed: false,
inactive: false,
leave: ‘window’,
distance: false
},
// 样式相关
style: {
// 样式名称
classes: ”,
widget: false,
width: false,
height: false,
// tip插件,箭头相关设置
tip: {
corner: true,
mimic: false,
width: 8,
height: 8,
border: true,
offset: 0
}
},
// 相关事件绑定
events: {
render: null,
move: null,
show: null,
hide: null,
toggle: null,
visible: null,
focus: null,
blur: null
}
};
看起来是很多,但是使用频率最高的估计也就以下这些参数:
$.fn.qtip.defaults = {
content: {
text: true,
attr: ‘title’,
ajax: false,
title: {
text: false,
button: false
}
},
position: {
my: ‘top left’,
at: ‘bottom right’,
},
show: {
event: ‘mouseenter’,
solo: false,
ready: false,
modal: false
},
hide: {
event: ‘mouseleave’
},
style: ‘ui-tooltip-default’
};
对于显示的位置,有以下参数可以设置:
my = [
‘top left’, ‘top right’, ‘top center’,
‘bottom left’, ‘bottom right’, ‘bottom center’,
‘right center’, ‘right top’, ‘right bottom’,
‘left center’, ‘left top’, ‘left bottom’, ‘center’
]
at = [
‘bottom left’, ‘bottom right’, ‘bottom center’,
‘top left’, ‘top right’, ‘top center’,
‘left center’, ‘left top’, ‘left bottom’,
‘right center’, ‘right top’, ‘right bottom’, ‘center’
]
而对于显示的色彩风格则有以下各种颜色:
[‘red’, ‘blue’, ‘dark’, ‘light’, ‘green’,’jtools’, ‘plain’, ‘youtube’, ‘cluetip’, ‘tipsy’, ‘tipped’]










