你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/463384-confettijs-org/discussions/179215,源站連結 點此以跳轉。
Confetti generator
Yeah, it's not my code, and I found the same thing. I simply copied it from confettijs.org to GreasyFork so I could link it into a userscript for testing (the original site isn't configured to allow cross-site linking).
Anyway, the documentation is really lacking. I did eventually get it to work, but the code is only designed to make confetti pop out of a button, which is not how I wanted to use it. So, I'm writing my own alternative that only borrows from the general concept of confettijs. If you'd like, I can post a reply to you again to let you know if/when I post my own confetti module. It may be a while, though. I only have a few minutes to spare occasionally.
Confetti is not working inside the function or click event
and it does not show any error in console
$('.confetti').click(function(e) {
let voucherVal = $('.voucher-input').val()
if (voucherVal == '') {
$('.error-msg').removeClass('d-none')
$('.success-msg').addClass('d-none')
} else {
let confetti = new Confetti('btn');
$('.error-msg').addClass('d-none')
$('.success-msg').removeClass('d-none')
}
});