页面中 导入css和js文件
1 2 | < link rel = "stylesheet" href = "css/jQuery.toolTip.css" media = "screen" /> < script type = "text/javascript" src = "js/jQuery.toolTip.js" ></ script > |
在初始化页面时加载
1 | $( '.tooltip' ).toolTip(); |
在使用title属性的元素中 加入class="tooltip"
1 | < a href = "" class = "tooltip" title="<img src = 'images/user.png' >< br /> wahahaha< br />< h1 >真、善、忍</ h1 >"> |
OK !
这个插件有个小问题,特意登陆评论一下。
“当title内是纯字母或纯数字,过多且中间没有空格时,内容会超出底层的黑色方框”
相信作者是以‘空格’来区分换行的,
1 2 | < a href = "#" class = "tooltip" title = "Straight to your inbox Be the first to Straight to your inbox 00000000000000000000000000000018888888888" >RSS FEED</ a > < a href = "#" class = "tooltip" title = "Straight to your inbox Be the first to Straight to your inbox aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaa" >RSS FEED</ a > |
现在项目中有个title需要提示纯单号的需求,所以发现了这个问题,有望作者能够尽快修复。
其余挺好用,支持一下,不错!
回复如果能做上弹出窗体边缘与window窗口边缘的碰撞判断,那就非常完美了