使用$.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'
});
}});
|
本文介绍如何使用jQuery Tooltip插件创建动态提示框。通过简单的HTML结构结合JavaScript配置,可以实现带有自定义样式的提示信息,并支持通过Ajax获取内容。
7573

被折叠的 条评论
为什么被折叠?



