I am working to build a confetti effect with pure JavaScript. right now i am getting nan error when i try to convert the following code with DOMContentlocaded method:
$(document).ready(function(){
console.log("Inside the DOMCONTENT LOADED FUNCTION")
SetGlobals();
//InitializeButton();
InitializeConfetti();
window.resize = function (event) {
W = window.innerWidth;
H = window.innerHeight;
canvas.width = W;
canvas.height = H;
};
window.setTimeout(DeactivateConfetti, 4000000);
});
Here's the fiddle link: Confetti Link