Greasy Fork is available in English.
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 em elegant alert()库
在 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));
}
})();
new
关键字后一切正常。非常不错的库!
同时调用多个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));
}
})();