自制tooltip插件

来源:互联网 发布:数据冗余 编辑:程序博客网 时间:2024/05/01 15:55

github地址:https://github.com/liuzaijiang/tooltip-liuzj (求★)

效果图:

使用方法:

var array=[              {                selector:"#p1", //需要绑定tooltip的元素,使用jq选择器来选择                direction:"top",//提示框出现的地方,“上,下,左,右”                string:"上方提示"//需要提示的字符              },              {//使用数组进行批量绑定                selector:"#p2",                direction:"bottom",                string:"下方提示"              },              {                selector:"#p3",                direction:"left",                string:"左方提示"              },              {                selector:"#p4",                direction:"right",                string:"右方提示"              }           ]     createToolTip(array);//将数组传入再调用此函数即可