使用$.fn.tooltip.defaults可以重写默认值对象
当用户将鼠标移动到元素上的时候,将会显示一个消息提示框。提示框的内容可以是页面中任何一个HTML元素或者通过Ajax发送后台请求以获取提示框内容。
Class方法调用
1
|
<
a
href
=
"#"
title
=
"This is the tooltip message."
class
=
"easyui-tooltip"
>Hover me</
a
>
|
JS调用
HTML
1
|
<
a
id
=
"dd"
href
=
"javascript:void(0)"
>Click here</
a
>
|
JS
1
2
3
4
5
6
7
8
9
|
$(
'#dd'
).tooltip({
position:
'right'
,
content:
'<span style="color:#fff">This is the tooltip message.</span>'
,
onShow:
function
(){
$(
this
).tooltip(
'tip'
).css({
backgroundColor:
'#666'
,
borderColor:
'#666'
});
}});
|