jquery tooltip插件
2017-01-29 23:42 youxin 阅读(443) 评论(0) 编辑 收藏 举报
qtip2:http://qtip2.com/
bower install qtip2 // lowercase!
引入一个css和插件即可。
<script type="text/javascript" src="/path/to/jquery.qtip.js"></script>
如果需要更多的支持,则引入相应的扩展。
qtip2下面后里面有个basic文件夹,里面的文件和外面文件名相同,但内容不同。
外面的js包含了插件Plugins: tips modal viewport svg imagemap ie6,。
而basic下面的没有包含插件。
样式:
/* Basic styles */ .qtip-light{} /* Light coloured style */ .qtip-dark{} /* Alternative dark style */ .qtip-cream{} /* Cream-esque style, similar to the default */ .qtip-red{} /* Alert-ful red style */ .qtip-green{} /* Positive green style */ .qtip-blue{} /* Informative blue style */ /* CSS3 styles */ .qtip-rounded{} /* CSS3 border-radius class for applying rounded corners to your tooltips */ .qtip-shadow{} /* CSS3 box-shadow class for applying shadows to your tooltips */ .qtip-bootstrap{} /* Twitter Bootstrap style */ .qtip-youtube{} /* Google's new YouTube style */ .qtip-tipsy{} /* Minimalist Tipsy style */ .qtip-tipped{} /* Tipped libraries "Blue" style */ .qtip-jtools{} /* jTools tooltip style */ .qtip-cluetip{} /* Good ole' ClueTip style */
http://qtip2.com/guides
使用方法:
JavaScript String
If you just want a common piece of text shared between all your tooltips, you can supply qTip2 directly with a JavaScript String
$('a').qtip({ // Grab some elements to apply the tooltip to
content: {
text: 'My common piece of text here'
}
})
$('.selector').qtip({ content: 'My content' });
)
title attribute
If you plan on using qTip2 as simply a very thin replacement of the browser tooltips, the title attribute is a great way to do so. It's standards compliant, it's the expected place for tooltip text, and the plugin will automaically look there for its content if none is given inside your .qtip({ ... })
config object!
$('[title]').qtip(); // Grab all elements with a title attribute, and apply qTip!
$('[title!=""]').qtip(); // A bit better. Grab elements with a title attribute that isn't blank.
This is the simplest method of using qTip2 , as it requires very little setup and works to replace existing, native tooltips auto-magically!
使用参考:
http://blog.csdn.net/smartsmile2012/article/details/17169443
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通