I have an HTML Button that wraps an image tag and has an onmouseup and onmousedown handler defined. When the button is down the image changes to the pressed image and when it’s up it changes to the up image. The issue is if the user drags their mouse off of the button while it’s down, the onmouseup event is never called so the image stays in the pressed state. Here’s an example of what’s going on. Try clicking the button and dragging off of it: http://jsfiddle.net/gsingh93/ubyV8/5/
How would I fix this?
Call mouseUp() when the mouse leaves the button: