简体   繁体   中英

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.

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:

<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'
     }
    });  
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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