1 person found this helpful
Not bizarre at all! Totally valid question to ask.
Let's use this scenario: I want to push a button, and as long as I'm holding the button I have a graphic of water filling up in a glass. When I stop holding, another animation plays to "splash" the water and stop it animating in. I would use a mouseup event to trigger that final splash animation.
For most cases you can get away with a click, but if you want someone to "hold" then have something happen on release that's when you'd use a mouseup event.
Great example Sarah! Thanks!!!
I think I'm going to rename the click 'click-n-hold' ;-)
Can also see that for simple animations it doesn't necessarily matter which of the two is selected, as they both result in the action occuring ;-)
While we're at it, it'd be good to learn the difference between click and touch events (if you haven't brushed up already)
Click vs. touchstart - these behave differently on desktop vs. mobile. If you need to duplicate functionality, a click will work probably 90% of the time. If you're making a mobile-focused project, be sure to use the touch events. Touchstart allows you to use multitouch (can't multitouch with click) and responds slightly faster than a click.
and... 'the more you know' ... the more you realise there is to know & learn ... and share
To complete Sarah's excellent illustration : a click is the succession of a mousedown and a mouseup.
As a rule of thumb, avoid programming buttons on mousedown, but always prefer mouseup.
If your user has clicked the button by mistake, a mousedown event handler will run, offering no recovery.
By contrast, with a mouseup event handler, the user is offered the opportunity to move the pointer outside of the button, mouse button pressed, then release it without firing the event handler. User-friendly, isn't it