I know that there is a lot of questions like mine, but I don't think it's a duplicate.
I want to create my own custom event, for exemple onresize or onshake.
And I would like to make a library, then the user of my library would just write that :
<script src="theLib.js" ></script>
<script>
window.addEventListener("shake",myFunc,false);
</script>
I saw a lot of tutoriels and questions on stackoverflow but either they are using jQuery(I want the most simple exemple to make a custom event) or the user must not just write window.addEventListener
.
Can you please explain me the most basic way to add a custom event?