jquery tooltip, but on click instead of hover

后端 未结 3 630
傲寒
傲寒 2020-12-10 07:12

We were using \'title\' attributes to display something on mouseover. We want it now to display on a click. How can I get a floating box that looks like a title/tooltip, b

3条回答
  •  失恋的感觉
    2020-12-10 07:43

    You might want to try this library:

    http://craigsworks.com/projects/qtip/

    And then simply call .qtip on a .click event handler.

    $('#myInput').click(function(){/*insert qtip code here*/});
    

    Note: you can grab the title attribute dynamically to use that content in the qtip tooltips, if you so choose.

提交回复
热议问题