简体   繁体   English

如何使用qTip2和jQuery和.hover函数显示标题?

[英]How to show the title with qTip2 and jQuery with .hover function?

I am trying to set a title in my element at my JSP page using qTip2 and jQuery with a .hover function. 我正在尝试使用带有.hover函数的qTip2和jQuery在我的JSP页面的元素中设置标题。

Code: 码:

$(document).ready(function() {
    $('#send').qtip({
        content: {
            title: 'My Title'
        }
    });
});   

the "send" is a button and I am trying to hover the mouse and get a message with the title. “发送”是一个按钮,我试图将鼠标悬停并获得带有标题的消息。

Ok, I got the answer here. 好的,我在这里得到了答案。

Add the CSS: 添加CSS:

<link rel="stylesheet" href="css/jquery.qtip.min.css">

Add the libraries: 添加库:

<script src="jquery/jquery-1.11.2.min.js"></script>
<script src="jquery/jquery.qtip.min.js"></script>

And the script: 和脚本:

$(document).ready(function() {
    alert('a');
    $('#send').qtip({ // Grab some elements to apply the tooltip to
      content: {
         text: 'My common piece of text here'
     }
    });  
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM