鼠标输入时未显示工具提示

tooltip not showing on mouse enter

本文关键字:显示 工具提示 输入 鼠标      更新时间:2023-09-26

我正在使用 qtip2 显示表中链接的工具提示,我在鼠标回车时调用它。问题是工具提示未显示,但警报有效,我无法弄清楚为什么工具提示不显示。感谢您的任何帮助。

$('#tblOrder tr td a').on('mouseenter',function(){

       alert('');
       var id = $('#tblOrder tr[id*="row"]').attr('id').substr(3);
          $(".proper a").qtip({
            content: {
            text: 'Loading.....',
                ajax: {
                url: '<%=Url.Action("Alarms") %>',
                type: 'POST',
                data: {id: id},
                success: function(data, status){
                    this.set('content.text', data);
                },
                error: function(xhr){
                    console.log(xhr.responseText);
                    console.log($('#tblOrder tr[id*="row"]').attr('id').substr(3));
                }
              }
            },
            show: {
        effect: function() {
            $(this).slideDown();
        }
    },
    hide: {
        effect: function() {
            $(this).slideUp();
        }
    }
            });
       });

我在这里创建了一个 jsfiddle

你在这里 http://jsfiddle.net/f0sbo0vd/3/

$(document).on('mouseenter', '#tblOrder tr a', function(event) {
    $(".proper a").qtip({        
         content: {
             text: 'Loading.....',
             ajax: {
                 url: '<%=Url.Action("Alarms") %>',
                 type: 'POST',
                 success: function (data, status) {
                     this.set('content.text', data);
                 },
                 error: function (xhr) {
                     console.log(xhr.responseText);                  
                 }
             }
         },
         show: {
             event: event.type,
             ready: true,
             effect: function () {
                 $(this).slideDown();
             }
         },
         hide: {
             effect: function () {
                 $(this).slideUp();
             }
         }
     }, event);
 });

编辑

要在链接上显示 qtip,请使用此 http://jsfiddle.net/f0sbo0vd/5/

只需更改

$(".proper a").qtip({ ... });

$(this).qtip({ ... });