簡體   English   中英

一段時間后如何隱藏qtip工具提示?

[英]How to hide qtip tooltip after some time has passed?

我正在使用 qtip ( http://craigsworks.com/projects/qtip/ ) 來制作工具提示。 現在我需要在按下按鈕時顯示工具提示並隱藏工具提示,例如在 3 秒過去后。 我當前的代碼不起作用,工具提示有時會消失有時會保留...

var self = $("#email");
self.qtip({
    content: error,
    tip: true,
    position: { corner: { target: 'rightMiddle', tooltip: 'leftMiddle' } },
    style: 'error',
    show: { when: false, ready: true },
    hide: { when: { event: 'mousemove' }, delay: 2000, effect: function () { self.qtip("destroy"); } }
});

@newbie,但回應是整理代碼,這可能就是問題所在。 例如,用“this”替換變量“self”的名稱。

$("#email").qtip( { 
   content: error, 
   tip: true,
   position: { corner: { target: 'rightMiddle', tooltip: 'leftMiddle' } }, 
   style: 'error',
   show: { when: false, ready: true }, 
   hide: { when: { event: 'mousemove' }, 
           delay: 2000, 
           effect: function() { $(this).qtip("destroy"); }
         }
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM