Greasy Fork is available in English.

elegant alert()库

Customized alert box at the top right corner, auto close in a few seconds. Click on the alert box will close it immediately and copy the alert message to clipboard.

< Feedback on elegant alert()库

Review: Good - script works

PYUDNGAuthor
§
Posted: 2021.06.13.

同时调用多个Alert,只有最后一个可以消失,其余的既不会自动消失,点击也不能消失

示例代码:

// ==UserScript==
// @name elegant alert Test
// @namespace elegant alert Test
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://greasyfork.org/zh-CN/scripts/425166*
// @icon https://www.google.com/s2/favicons?domain=greasyfork.org
// @grant none
// @require https://greasyfork.org/scripts/425166-elegant-alert-%E5%BA%93/code/elegant%20alert()%E5%BA%93.js?version=922763
// ==/UserScript==

(function() {
'use strict';

// Your code here...
ElegantAlertBox('test');

for (let i = 0; i < 10; i++) {
ElegantAlertBox('loopTest ' + String(i));
}
})();

kakasearchAuthor
§
Posted: 2021.06.18.

在 ElegantAlertBox 前加 new 关键字
修改后的示例代码
// ==UserScript==
// @name elegant alert Test
// @namespace elegant alert Test
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://greasyfork.org/zh-CN/scripts/425166*
// @icon https://www.google.com/s2/favicons?domain=greasyfork.org
// @grant none
// @require https://greasyfork.org/scripts/425166-elegant-alert-%E5%BA%93/code/elegant%20alert()%E5%BA%93.js?version=922763
// ==/UserScript==

(function() {
'use strict';

// Your code here...
new ElegantAlertBox('test');

for (let i = 0; i < 10; i++) {
new ElegantAlertBox('loopTest ' + String(i));
}
})();

PYUDNGAuthor
§
Posted: 2021.06.18.

感谢作者!添加new关键字后一切正常。非常不错的库!

Post reply

Sign in to post a reply.