详情参考:
http://qtip2.com
我下载的 库文件以及自己总结的资料:
链接:http://pan.baidu.com/s/1pJI43Cv密码:751y
基本用法:
(1)只有简单提示
$('#username').qtip({ // Grab some elements to apply the tooltipto
});
(2)带标题的
$('#password').qtip({ // Grabsome elements to apply the tooltip to
title:"演示",
(3)设置位置
$('#password').qtip({ // Grab some elements to apply the tooltipto
title:"演示",
,
position:{
},
style:{
}
});
my:是指三角的位置
at:是在提示在组件的相对位置
(top 上 bottom下 )( left左 right右center中)
两组配合使用
(4)设置风格
$('#password').qtip({ // Grab someelements to apply the tooltip to
title:"演示",
,
position:{
},
style:{
}
});
qtip-light浅色
qtip-dark 深色
qtip-cream
qtip-red
qtip-blue
qtip-shadow
qtip-rounded圆角
qtip-youtube
qtip-jtools
qtip-cluetip
qtip-tipsy
qtip-tip
qtip-titlebar
qtip-default
可以自定义 上面的qtip-purple就是我自己定义的
.qtip-purple{background-color:#9FF0E1;border-color:#EEC933;color:#42B453}.qtip-purple.qtip-titlebar{background-color:#9465E1}
background-color是内容的背景颜色
border-color:整个的边框
color:文字的颜色
.qtip-purple.qtip-titlebar{background-color: #9465E1} 设置的是标题的背景色
标题还可以设置标题文字颜色
.qtip-purple .qtip-titlebar{background-color:#9465E1;
color:red
}
(6)显示 隐藏 重置等
$('.selector').qtip('reposition');// Reposition all tooltips belonging to the selected elements重置该选择器选中元素的提示组件
$('.selector').qtip('disable');// Disable all tooltips belonging to the selectedelements
该选择器选中元素的提示组件设为不可用状态
$('.selector').qtip('toggle',true);// 显示该选择器选中元素的提示组件$('.selector').qtip('destroy',true);// 直接销毁属于该选择器选中元素的提示组件
(7)修改值
$(“#username”).qtip('api').set('content.text','这里是内容');
$(“#username”).qtip('api').set('content.text','这里是修改后的内容')..set('content.title','这里是修改后的标题');