Toastr:如何防止在鼠标悬停时使用粘性吐司淡出?

时间:2013-07-01 18:25:52

标签: notifications mouseover messages sticky toastr

我一直在玩toastr并且已经成功地将超时设置为0,因此吐司仍然是粘性的,但是当我将鼠标移出吐司时,吐司会消失。我想要覆盖它,所以如果用户点击它,烤面包就会消失 - 非常适合有大量文字的祝酒词。如何才能做到这一点?

3 个答案:

答案 0 :(得分:60)

extendedTimeOut也设为0。这将使它变得粘稠。

答案 1 :(得分:15)

timeOutextendedTimeOut必须设置为0

这是一个完整的例子:

toastr.options = {
    timeOut: 0,
    extendedTimeOut: 0
};

toastr.info("Testing <button>blah</button>");

对于那些不想在点击时关闭吐司的人,示例将更改为:

toastr.options = {
    timeOut: 0,
    extendedTimeOut: 0,
    tapToDismiss: false
};

toastr.info("Testing <button>blah</button>");

答案 2 :(得分:0)

您还可以使用#include <iostream> #include <conio.h> #include <string> using namespace std; // TODO: Implement the "SwapIntegers" function void swapIntegers(int *first, int *second) { int *pSwapIntegers = first; first = second; second = pSwapIntegers; } // Do not modify the main function! int main() { int first = 0; int second = 0; int *pFirst = new int (first); int *pSecond = new int (second); cout << "Enter the first integer: "; cin >> first; cout << "Enter the second integer: "; cin >> second; cout << "\nYou entered:\n"; cout << "first: " << first << "\n"; cout << "second: " << second << "\n"; swapIntegers(&first, &second); cout << "\nAfter swapping:\n"; cout << "first: " << *pFirst << "\n"; cout << "second: " << *pSecond << "\n"; cout << "\nPress any key to quit."; _getch(); return 0; } 作为将disableTimeOuttimeOut都设置为0的替代方法。

extendedTimeOut