confettijs.org

Confetti generator

< 腳本confettijs.org的回應

評論:普通 - 腳本能使用,但有一些問題

§
發表於:2023-04-19
編輯:2023-04-19

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')

}

});

§
發表於:2023-04-19

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.

發表回覆

登入以回復

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址